Skip to content

Commit

Permalink
Add securityContexts
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernPetersen committed Dec 27, 2024
1 parent 7018feb commit afe97b7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chart/templates/crons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ spec:
template:
spec:
restartPolicy: Never
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: app
image: {{ $.Values.image.app }}:{{ $.Values.appVersion }}
Expand All @@ -29,6 +33,10 @@ spec:
requests:
cpu: 1000m
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ ALL ]
env:
- name: DATABASE_PASSWORD
valueFrom:
Expand Down
12 changes: 12 additions & 0 deletions chart/templates/sts-update-handler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@ spec:
labels:
app: {{ .Release.Name }}-update-handler
spec:
securityContext:
seccompProfile:
type: RuntimeDefault
runAsNonRoot: true
initContainers:
- name: flyway
image: {{ .Values.image.migrations }}:{{ .Values.appVersion }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ ALL ]
envFrom:
- configMapRef:
name: {{ .Release.Name }}-db
Expand All @@ -50,6 +58,10 @@ spec:
requests:
cpu: 10m
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ ALL ]
env:
- name: DATABASE_PASSWORD
valueFrom:
Expand Down

0 comments on commit afe97b7

Please sign in to comment.