Skip to content

Commit 0a60429

Browse files
committed
Expose securityContext on pod level via helm values
Required to set the fsGroup and get the mounted IRSA token accessible to the operator
1 parent f350a3c commit 0a60429

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎operator/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ helm install securecodebox-operator secureCodeBox/operator
3131
| minio.defaultBucket.name | string | `"securecodebox"` | |
3232
| minio.enabled | bool | `true` | |
3333
| minio.resources.requests.memory | string | `"256Mi"` | |
34+
| podSecurityContext | object | `{}` | Sets the securityContext on the operators pod level. See: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container |
3435
| resources | object | `{"limits":{"cpu":"100m","memory":"30Mi"},"requests":{"cpu":"100m","memory":"20Mi"}}` | CPU/memory resource requests/limits (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/, https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/) |
3536
| s3.authType | string | `"access-secret-key"` | Authentication method. Supports access-secret-key (used by most s3 endpoint) and aws-irsa (Used by AWS EKS IAM Role to Kubenetes Service Account Binding. Support for AWS IRSA is considered experimental in the secureCodeBox) |
3637
| s3.awsStsEndpoint | string | `"https://sts.amazonaws.com"` | STS Endpoint used in AWS IRSA Authentication. Change this to the sts endpoint of your aws region. Only used when s3.authType is set to "aws-irsa" |
@@ -41,6 +42,7 @@ helm install securecodebox-operator secureCodeBox/operator
4142
| s3.port | string | `nil` | |
4243
| s3.secretAttributeNames.accesskey | string | `"accesskey"` | |
4344
| s3.secretAttributeNames.secretkey | string | `"secretkey"` | |
45+
| securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["all"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsNonRoot":true}` | Sets the securityContext on the operators container level. See: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod |
4446
| securityContext.allowPrivilegeEscalation | bool | `false` | Ensure that users privileges cannot be escalated |
4547
| securityContext.capabilities.drop[0] | string | `"all"` | This drops all linux privileges from the operator container. They are not required |
4648
| securityContext.privileged | bool | `false` | Ensures that the operator container is not run in privileged mode |

‎operator/templates/manager/manager.yaml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ spec:
1616
control-plane: securecodebox-controller-manager
1717
spec:
1818
serviceAccountName: {{ .Values.serviceAccount.name }}
19-
# todo(@J12934): this should be configurable, unfortunatly it can't go into the containers security context... :(
2019
securityContext:
21-
fsGroup: 1001
20+
{{ .Values.podSecurityContext | toYaml | nindent 8 }}
2221
containers:
2322
- command:
2423
- /manager

‎operator/values.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ serviceAccount:
2323
# -- Labels of the serviceAccount the operator uses to talk to the k8s api
2424
labels: {}
2525

26+
# -- Sets the securityContext on the operators container level. See: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
2627
securityContext:
2728
# securityContext.runAsNonRoot -- Enforces that the Operator image is run as a non root user
2829
runAsNonRoot: true
@@ -37,6 +38,9 @@ securityContext:
3738
# securityContext.capabilities.drop[0] -- This drops all linux privileges from the operator container. They are not required
3839
- all
3940

41+
# -- Sets the securityContext on the operators pod level. See: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
42+
podSecurityContext: {}
43+
4044
lurcher:
4145
image:
4246
# lurcher.image.repository -- The operator image repository

0 commit comments

Comments
 (0)