Skip to content

Commit

Permalink
feat: Add pod securityContext to helm chart
Browse files Browse the repository at this point in the history
The current helm chart does not permit to add a pod-level security context, only a container-level security context. The helm chart is extended with an optional pod-level security context.

Fix #1240
  • Loading branch information
hsudbrock authored and phbelitz committed Sep 29, 2023
1 parent 5d07c3c commit 758e767
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: connaisseur
description: Helm chart for Connaisseur - a Kubernetes admission controller to integrate container image signature verification and trust pinning into a cluster.
type: application
version: 2.0.0
version: 2.1.0
appVersion: 3.0.0
keywords:
- container image
Expand Down
6 changes: 6 additions & 0 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ spec:
{{- with .Values.kubernetes.deployment.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.kubernetes.deployment.podSecurityContext }}
{{- with .Values.kubernetes.deployment.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- name: {{ .Chart.Name }}-certs
Expand Down
3 changes: 3 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ kubernetes:
weight: 100
#annotations: # uncomment when using Kubernetes prior v1.19
# seccomp.security.alpha.kubernetes.io/pod: runtime/default # uncomment when using Kubernetes prior v1.19
# container wide security context
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand All @@ -48,6 +49,8 @@ kubernetes:
runAsGroup: 20001 # remove when using openshift or OKD 4
seccompProfile: # remove when using Kubernetes prior v1.19, openshift or OKD 4
type: RuntimeDefault # remove when using Kubernetes prior v1.19, openshift or OKD 4
# pod wide security context
podSecurityContext: {}
# PodSecurityPolicy is deprecated as of Kubernetes v1.21, and will be removed in v1.25
podSecurityPolicy:
enabled: false
Expand Down

0 comments on commit 758e767

Please sign in to comment.