Skip to content

Commit d223943

Browse files
authored
fix(helm): allow shared supervisor SCC-assigned IDs (#4785)
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 837fdfd commit d223943

5 files changed

Lines changed: 33 additions & 6 deletions

File tree

‎deploy/helm/openshell/README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,11 @@ discovery endpoint or its TLS CA.
585585
| supervisor.image.registry | string | `""` | Supervisor image registry. Empty uses global.image.registry. |
586586
| supervisor.image.repository | string | `"openshell/supervisor"` | Supervisor image repository. |
587587
| supervisor.image.tag | string | `""` | Supervisor image tag. Defaults to the chart appVersion when empty. |
588+
| supervisor.podSecurityContext.fsGroup | int | `65534` | fsGroup assigned to the shared supervisor pod. |
589+
| supervisor.podSecurityContext.runAsGroup | int | `65534` | Primary GID assigned to the shared supervisor pod. |
590+
| supervisor.podSecurityContext.runAsNonRoot | bool | `true` | Require the shared supervisor to run as a non-root user. |
591+
| supervisor.podSecurityContext.runAsUser | int | `65534` | UID assigned to the shared supervisor pod. |
592+
| supervisor.podSecurityContext.seccompProfile.type | string | `"RuntimeDefault"` | Seccomp profile applied to the shared supervisor pod. |
588593
| supervisor.sandboxRuntime.boundaryPort | int | `5500` | Workload boundary TLS listener port. |
589594
| tolerations | list | `[]` | Tolerations for the gateway pod. |
590595
| upstreamProxy | object | `{"authAllowInsecure":false,"authSecret":{"key":"","name":""},"caBundle":{"configMapName":"","key":"ca.crt"},"connectByHostname":false,"noProxy":"","url":""}` | Operator-owned corporate forward proxy for policy-approved TLS egress from Kubernetes sandboxes. The workload cannot select or override it. |

‎deploy/helm/openshell/ci/values-openshift-scc.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ securityContext:
1818
capabilities:
1919
drop:
2020
- ALL
21+
22+
# The shared supervisor keeps runAsNonRoot and its seccomp profile; the SCC
23+
# assigns its user, group, and fsGroup IDs.
24+
supervisor:
25+
podSecurityContext:
26+
runAsUser: null
27+
runAsGroup: null
28+
fsGroup: null

‎deploy/helm/openshell/templates/supervisor.yaml‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,10 @@ spec:
3939
- name: {{ . | quote }}
4040
{{- end }}
4141
{{- end }}
42+
{{- with .Values.supervisor.podSecurityContext }}
4243
securityContext:
43-
runAsNonRoot: true
44-
runAsUser: 65534
45-
runAsGroup: 65534
46-
fsGroup: 65534
47-
seccompProfile:
48-
type: RuntimeDefault
44+
{{- toYaml . | nindent 8 }}
45+
{{- end }}
4946
containers:
5047
- name: supervisor
5148
image: {{ get $kubernetes "supervisor_image" | quote }}

‎deploy/helm/openshell/values.yaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ supervisor:
6969
tag: ""
7070
# -- Supervisor image digest. When set, this takes precedence over tag.
7171
digest: ""
72+
# Pod security context for the shared supervisor Deployment, rendered only
73+
# when gatewayConfig selects supervisor_topology = "gateway". On OpenShift,
74+
# set the user and group IDs to null so the restricted-v2 SCC can assign the
75+
# namespace range; ci/values-openshift-scc.yaml does this.
76+
podSecurityContext:
77+
# -- Require the shared supervisor to run as a non-root user.
78+
runAsNonRoot: true
79+
# -- UID assigned to the shared supervisor pod.
80+
runAsUser: 65534
81+
# -- Primary GID assigned to the shared supervisor pod.
82+
runAsGroup: 65534
83+
# -- fsGroup assigned to the shared supervisor pod.
84+
fsGroup: 65534
85+
seccompProfile:
86+
# -- Seccomp profile applied to the shared supervisor pod.
87+
type: RuntimeDefault
7288
sandboxRuntime:
7389
# -- Workload boundary TLS listener port.
7490
boundaryPort: 5500

‎skills/debug-openshell-cluster/SKILL.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,7 @@ credential failures.
12791279
| One replica holds most sessions after a rollout | Expected: sessions stay where they reconnected | `openshell_server_supervisor_sessions` per pod; it fades as sandboxes are recreated |
12801280
| Gateway or `<release>-certgen` hook pod rejected with `violates PodSecurity "restricted:latest"` | The rendered container lacks `runAsNonRoot` or `seccompProfile`: an older chart version does not set them, or an override in `securityContext` / `pkiInitJob.securityContext` unset them | `kubectl -n openshell get events --field-selector reason=FailedCreate`; upgrade the chart, then remove overrides that unset those fields |
12811281
| OpenShift gateway pod fails to start with an SCC/`runAsUser` error (e.g. `unable to validate against any security context constraint`) | Chart's default `podSecurityContext`/`securityContext` hardcodes `runAsUser`/`fsGroup`, which the restricted-v2 SCC rejects; it must instead inject the namespace-assigned UID/GID range | `oc -n openshell describe pod <pod>`; deploy with `podSecurityContext: null` and clear `securityContext.runAsUser` (see `deploy/helm/openshell/ci/values-openshift-scc.yaml`) |
1282+
| OpenShift `<release>-supervisor` Deployment never creates pods after setting `supervisor_topology = "gateway"` (SCC `runAsUser`/`fsGroup` not in the namespace range) | `supervisor.podSecurityContext` defaults `runAsUser`, `runAsGroup`, and `fsGroup` to 65534, outside the namespace's assigned UID/GID ranges | `kubectl -n openshell get events --field-selector reason=FailedCreate`; compare with the `openshift.io/sa.scc.*` annotations from `oc describe ns openshell`; set `supervisor.podSecurityContext.runAsUser`, `.runAsGroup`, and `.fsGroup` to `null`, as `deploy/helm/openshell/ci/values-openshift-scc.yaml` does, and keep `runAsNonRoot` and `seccompProfile` |
12821283
| OpenShift sandbox pod fails to start (`unable to validate against any security context constraint`) | The `openshell-sandbox` service account lacks the privileged SCC it needs | `oc adm policy add-scc-to-user privileged -z openshell-sandbox -n openshell`; remove with `remove-scc-from-user` when done |
12831284
| OpenShift self-hosted Vault/OpenBao credential store pod never schedules (waits time out with `no matching resources found`) | The store's Helm chart pins `runAsUser`/`fsGroup`/seccomp, which restricted-v2 rejects, so the StatefulSet controller never creates the pod | Deploy the store's chart in its OpenShift mode (`--set global.openshift=true` for the OpenBao/Vault chart) so the namespace SCC assigns a compliant security context — no manual SCC grant needed |
12841285
| Vault credential driver returns HTTP 403 / `Vault Kubernetes auth denied the configured role` on provider create | Vault's `auth/kubernetes` method or the gateway login role is not provisioned, or the role is not bound to the gateway service account and namespace | In Vault: `bao auth enable kubernetes` and `bao write auth/kubernetes/config kubernetes_host=... kubernetes_ca_cert=@...`; ensure the login role's `bound_service_account_names`/`bound_service_account_namespaces` match the gateway SA and namespace and its policy grants the credential paths |

0 commit comments

Comments
 (0)