Skip to content

Commit 59e821a

Browse files
committed
chore: add existing securityContext settings to values
To allow values to be set that satisfy the [restricted Pod Security Standard](https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted) Signed-off-by: Arron Francis <[email protected]>
1 parent fda221c commit 59e821a

File tree

4 files changed

+77
-9
lines changed

4 files changed

+77
-9
lines changed

deploy/charts/google-cas-issuer/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,5 +213,28 @@ For example:
213213
> ```
214214
215215
Optional priority class to be used for the google-cas-issuer pods.
216+
#### **securityContext** ~ `object`
217+
> Default value:
218+
> ```yaml
219+
> runAsNonRoot: true
220+
> seccompProfile:
221+
> type: RuntimeDefault
222+
> ```
223+
224+
Pod Security Context.
225+
For more information, see [Configure a Security Context for a Pod or Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/).
226+
227+
#### **containerSecurityContext** ~ `object`
228+
> Default value:
229+
> ```yaml
230+
> allowPrivilegeEscalation: false
231+
> capabilities:
232+
> drop:
233+
> - ALL
234+
> readOnlyRootFilesystem: true
235+
> ```
236+
237+
Container Security Context to be set on the controller component container. For more information, see [Configure a Security Context for a Pod or Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/).
238+
216239
217-
<!-- /AUTO-GENERATED -->
240+
<!-- /AUTO-GENERATED -->

deploy/charts/google-cas-issuer/templates/deployment.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ spec:
2727
{{- toYaml . | nindent 8 }}
2828
{{- end }}
2929
spec:
30+
{{- with .Values.securityContext }}
3031
securityContext:
31-
runAsNonRoot: true
32-
seccompProfile: { type: RuntimeDefault }
33-
32+
{{- toYaml . | nindent 8 }}
33+
{{- end }}
3434
{{- with .Values.imagePullSecrets }}
3535
imagePullSecrets:
3636
{{- toYaml . | nindent 8 }}
@@ -53,12 +53,10 @@ spec:
5353
resources:
5454
{{- toYaml . | nindent 10 }}
5555
{{- end }}
56-
56+
{{- with .Values.containerSecurityContext }}
5757
securityContext:
58-
allowPrivilegeEscalation: false
59-
capabilities: { drop: ["ALL"] }
60-
readOnlyRootFilesystem: true
61-
58+
{{- toYaml . | nindent 10 }}
59+
{{- end }}
6260
{{- with .Values.nodeSelector }}
6361
nodeSelector:
6462
{{- toYaml . | nindent 8 }}

deploy/charts/google-cas-issuer/values.schema.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"commonLabels": {
1313
"$ref": "#/$defs/helm-values.commonLabels"
1414
},
15+
"containerSecurityContext": {
16+
"$ref": "#/$defs/helm-values.containerSecurityContext"
17+
},
1518
"crds": {
1619
"$ref": "#/$defs/helm-values.crds"
1720
},
@@ -48,6 +51,9 @@
4851
"resources": {
4952
"$ref": "#/$defs/helm-values.resources"
5053
},
54+
"securityContext": {
55+
"$ref": "#/$defs/helm-values.securityContext"
56+
},
5157
"serviceAccount": {
5258
"$ref": "#/$defs/helm-values.serviceAccount"
5359
},
@@ -151,6 +157,19 @@
151157
"description": "Labels to apply to all resources",
152158
"type": "object"
153159
},
160+
"helm-values.containerSecurityContext": {
161+
"default": {
162+
"allowPrivilegeEscalation": false,
163+
"capabilities": {
164+
"drop": [
165+
"ALL"
166+
]
167+
},
168+
"readOnlyRootFilesystem": true
169+
},
170+
"description": "Container Security Context to be set on the controller component container. For more information, see [Configure a Security Context for a Pod or Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/).",
171+
"type": "object"
172+
},
154173
"helm-values.crds": {
155174
"additionalProperties": false,
156175
"properties": {
@@ -261,6 +280,16 @@
261280
"description": "Kubernetes pod resource requests/limits for google-cas-issuer.\nFor example:\nlimits:\n cpu: 100m\n memory: 128Mi\nrequests:\n cpu: 100m\n memory: 128Mi",
262281
"type": "object"
263282
},
283+
"helm-values.securityContext": {
284+
"default": {
285+
"runAsNonRoot": true,
286+
"seccompProfile": {
287+
"type": "RuntimeDefault"
288+
}
289+
},
290+
"description": "Pod Security Context.\nFor more information, see [Configure a Security Context for a Pod or Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/).",
291+
"type": "object"
292+
},
264293
"helm-values.serviceAccount": {
265294
"additionalProperties": false,
266295
"properties": {

deploy/charts/google-cas-issuer/values.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,24 @@ tolerations: []
115115
# Optional priority class to be used for the google-cas-issuer pods.
116116
priorityClassName: ""
117117

118+
# Pod Security Context.
119+
# For more information, see [Configure a Security Context for a Pod or Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/).
120+
# +docs:property
121+
securityContext:
122+
runAsNonRoot: true
123+
seccompProfile:
124+
type: RuntimeDefault
125+
126+
# Container Security Context to be set on the controller component container.
127+
# For more information, see [Configure a Security Context for a Pod or Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/).
128+
# +docs:property
129+
containerSecurityContext:
130+
allowPrivilegeEscalation: false
131+
capabilities:
132+
drop:
133+
- ALL
134+
readOnlyRootFilesystem: true
135+
118136
# Override the "cert-manager-google-cas-issuer.name" value.
119137
# +docs:property
120138
# nameOverride: "my-google-cas-issuer"

0 commit comments

Comments
 (0)