feat(helm): add pod-level securityContext support for certificate mounting (#19041)

**Add pod-level securityContext support to Coder Helm chart**

Adds `coder.podSecurityContext` field to enable pod-level security
settings, primarily to solve TLS certificate mounting permission issues.

**Problem**: When mounting TLS certificates from Kubernetes secrets, the
Coder process (UID 1000) cannot read the files due to restrictive
permissions.

**Solution**: Setting `podSecurityContext.fsGroup: 1000` ensures
Kubernetes sets group ownership of mounted volumes to GID 1000, allowing
the Coder process to read certificate files.

**Changes**:
- Added `podSecurityContext` field to values.yaml with documentation
- Updated `_coder.yaml` template to include pod-level security context
- Added test case and golden files
- Maintains backward compatibility (opt-in feature)

**Usage**:
```yaml
coder:
  podSecurityContext:
    fsGroup: 1000  # Enables TLS cert access
```

Fixes #19038
This commit is contained in:
Austen Bruhn
2025-07-28 18:41:32 -06:00
committed by GitHub
parent 72b8ab530e
commit faac75389b
6 changed files with 468 additions and 0 deletions
+4
View File
@@ -26,6 +26,10 @@ spec:
{{- toYaml .Values.coder.podAnnotations | nindent 8 }}
spec:
serviceAccountName: {{ .Values.coder.serviceAccount.name | quote }}
{{- with .Values.coder.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
restartPolicy: Always
{{- with .Values.coder.image.pullSecrets }}
imagePullSecrets: