diff --git a/deploy/helm/openshell/README.md b/deploy/helm/openshell/README.md index fa2f76cfa3..ad4dd9ce37 100644 --- a/deploy/helm/openshell/README.md +++ b/deploy/helm/openshell/README.md @@ -196,7 +196,7 @@ helm install openshell oci://quay.io/ai-openshell/charts/openshell --version --namespace openshell \ + --values operator-values.yaml +``` + +The gateway must trust the CA issuing the client certificate. Keep the default +`certManager.clientCaFromServerTlsSecret: true` and a non-empty +`server.tls.clientCaSecretName`. Alternatively, set +`certManager.clientCaFromServerTlsSecret: false` and point +`server.tls.clientCaSecretName` at `certManager.caSecretName`. + +Save this standalone manifest as `operator-certificate.yaml`. It assumes a +release named `openshell` in namespace `openshell`; adjust the namespace and +`issuerRef.name` to match the chart's `-ca-issuer` Issuer. + +```yaml +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: openshell-operator-client + namespace: openshell +spec: + secretName: openshell-operator-client-tls + commonName: platform-operator + subject: + organizationalUnits: + - operator + duration: 168h + renewBefore: 24h + privateKey: + algorithm: ECDSA + size: 256 + usages: + - client auth + - digital signature + issuerRef: + name: openshell-ca-issuer + kind: Issuer + group: cert-manager.io +``` + +Apply it and wait for issuance: + +```shell +kubectl apply -f operator-certificate.yaml +kubectl -n openshell wait certificate/openshell-operator-client --for=condition=Ready --timeout=120s +``` + +The exact `OU=operator` grants gateway-wide administration and access to +`GetProviderCredentials` when operator authentication is enabled. Restrict +access to the dedicated Secret and permission to issue certificates under the +trusted client CA. See [mTLS operators](/how-it-works/gateways/authentication#mtls-operators) +for the authorization and trust boundary. + +### Verify the certificate + +If you have `kubectl` access and want to verify that the certificate +authenticates correctly, use the following example. Export the certificate, +key, and server trust bundle: + +```shell +umask 077 +mkdir -p operator-tls +kubectl -n openshell get secret openshell-operator-client-tls -o jsonpath='{.data.tls\.crt}' | base64 --decode > operator-tls/tls.crt +kubectl -n openshell get secret openshell-operator-client-tls -o jsonpath='{.data.tls\.key}' | base64 --decode > operator-tls/tls.key +kubectl -n openshell get secret openshell-server-tls -o jsonpath='{.data.ca\.crt}' | base64 --decode > operator-tls/ca.crt +``` + +Keep a direct Service port-forward running: + +```shell +kubectl -n openshell port-forward svc/openshell 8090:8080 +``` + +In another terminal, use `grpcurl` to check the authenticated identity: + +```shell +grpcurl -cacert operator-tls/ca.crt \ + -cert operator-tls/tls.crt -key operator-tls/tls.key \ + -d '{}' localhost:8090 openshell.v1.OpenShell/GetCurrentUser +``` + +The response should identify `platform-operator`, include the `operator` role, +and report `identityProvider: "mtls"`. This confirms that the gateway recognizes +the certificate as an operator identity. Send requests without an +`Authorization` header, through a direct or TLS-passthrough connection. + +If the gateway presents an external server certificate, use that issuer's server +trust bundle for `ca.crt` instead of the chart CA. The operator client +certificate remains signed by the chart CA in this example. + +cert-manager renews the Kubernetes Secret according to the Certificate's +`duration` and `renewBefore`. Refresh any exported certificate and key files +after renewal and reconnect the application with the updated pair. + ## Using a real Issuer for the server certificate By default, cert-manager issues both the server and client certificates from diff --git a/docs/kubernetes/setup.mdx b/docs/kubernetes/setup.mdx index 854f1b644c..7739932729 100644 --- a/docs/kubernetes/setup.mdx +++ b/docs/kubernetes/setup.mdx @@ -132,7 +132,7 @@ pkiInitJob: The default Kubernetes driver puts all workspaces in one sandbox namespace. To have the gateway create a namespace for each workspace, follow -[Workspace on Kubernetes](/kubernetes/workspaces). +[Workspaces on Kubernetes](/kubernetes/workspaces). ### Split gateway and workspace releases diff --git a/docs/kubernetes/workspaces.mdx b/docs/kubernetes/workspaces.mdx index 816192fbb6..2ea0bc77ec 100644 --- a/docs/kubernetes/workspaces.mdx +++ b/docs/kubernetes/workspaces.mdx @@ -1,7 +1,7 @@ --- # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -title: "Workspace on Kubernetes" +title: "Workspaces on Kubernetes" sidebar-title: "Workspaces" description: "Configure how OpenShell workspaces map to Kubernetes namespaces, including managed per-workspace namespaces." keywords: "Kubernetes, Workspaces, Namespaces, Managed Mode, Helm, RBAC" diff --git a/skills/debug-openshell-cluster/SKILL.md b/skills/debug-openshell-cluster/SKILL.md index 029e81e7ac..9351671c0d 100644 --- a/skills/debug-openshell-cluster/SKILL.md +++ b/skills/debug-openshell-cluster/SKILL.md @@ -990,6 +990,15 @@ If the gateway pod is pending with `MountVolume.SetUp failed for volume `templates/certgen.yaml` output and the hook Job logs; cert-manager creates TLS Secrets but does not create the sandbox JWT signing Secret. +Operator certificates can be issued with a standalone cert-manager `Certificate` +using the chart's existing `-ca-issuer`. Verify exact `OU=operator`, +client authentication usage, and a chain trusted by the gateway client CA. +Authorization needs `gatewayConfig["openshell.gateway.mtls_auth"].operator_enabled=true` +and direct mTLS. Check the standalone Certificate's Ready condition and its +Secret's subject and expiry. Keep this dedicated Secret outside gateway, +supervisor, and workload pods. Exported CLI certificate/key files need refreshing +after renewal. See Managing Certificates in the published Kubernetes docs. + If the gateway exits with `failed to read sandbox JWT signing key from /etc/openshell-jwt/signing.pem`, verify that `openshell-jwt-keys` contains `signing.pem`, `public.pem`, and `kid`, and that the gateway workload mounts the