Skip to content

Commit 0ad0229

Browse files
committed
Fix Kubernetes CRD field structures for OIDC and authz config
Update all MCPServer YAML examples to use correct CRD field structure: 1. External IdP authentication: - Change spec.auth.oidc → spec.oidcConfig - Add required type: inline field - Nest configuration under inline: key 2. Kubernetes service account authentication: - Change spec.auth.oidc → spec.oidcConfig - Use type: kubernetes instead of inline - Replace clientId with serviceAccount and namespace fields 3. Authorization configuration: - Change spec.auth.authorization → spec.authzConfig - Add required type: configMap field - Update field names: configMapName → name, configMapKey → key These changes align with the actual ToolHive CRD definitions in toolhive/cmd/thv-operator/api/v1alpha1/mcpserver_types.go
1 parent efde704 commit 0ad0229

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

docs/toolhive/guides-k8s/auth-k8s.mdx

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ spec:
7777
type: builtin
7878
name: network
7979
# Authentication configuration for external IdP
80-
auth:
81-
oidc:
82-
audience: '<your-audience>'
83-
clientId: '<your-client-id>'
84-
issuer: '<https://your-oidc-issuer.com>'
85-
jwksUrl: '<https://your-oidc-issuer.com/path/to/jwks>'
80+
oidcConfig:
81+
type: inline
82+
inline:
83+
issuer: 'https://your-oidc-issuer.com'
84+
audience: 'your-audience'
85+
clientId: 'your-client-id'
86+
jwksUrl: 'https://your-oidc-issuer.com/path/to/jwks'
8687
resources:
8788
limits:
8889
cpu: '100m'
@@ -161,10 +162,12 @@ spec:
161162
type: builtin
162163
name: network
163164
# Authentication configuration for Kubernetes service accounts
164-
auth:
165-
oidc:
165+
oidcConfig:
166+
type: kubernetes
167+
kubernetes:
168+
serviceAccount: 'mcp-client'
169+
namespace: 'client-apps'
166170
audience: 'toolhive'
167-
clientId: 'mcp-client.client-apps.svc.cluster.local'
168171
issuer: 'https://kubernetes.default.svc'
169172
jwksUrl: 'https://kubernetes.default.svc/openid/v1/jwks'
170173
resources:
@@ -277,16 +280,20 @@ spec:
277280
type: builtin
278281
name: network
279282
# Authentication configuration
280-
auth:
281-
oidc:
283+
oidcConfig:
284+
type: kubernetes
285+
kubernetes:
286+
serviceAccount: 'mcp-client'
287+
namespace: 'client-apps'
282288
audience: 'toolhive'
283-
clientId: 'mcp-client.client-apps.svc.cluster.local'
284289
issuer: 'https://kubernetes.default.svc'
285290
jwksUrl: 'https://kubernetes.default.svc/openid/v1/jwks'
286-
# Authorization configuration
287-
authorization:
288-
configMapName: authz-config
289-
configMapKey: authz-config.json
291+
# Authorization configuration
292+
authzConfig:
293+
type: configMap
294+
configMap:
295+
name: authz-config
296+
key: authz-config.json
290297
resources:
291298
limits:
292299
cpu: '100m'

0 commit comments

Comments
 (0)