Skip to content

Commit

Permalink
Moved part of Kubernetes securityContext spec to container level
Browse files Browse the repository at this point in the history
This best practice applys the securityContext to all container in the deployment and reduces code duplications
  • Loading branch information
saidsef committed Aug 25, 2023
1 parent 527f299 commit ee8c882
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BAMBOO_VERSION=""
ARG PORT=""
ARG REF=""

LABEL org.opencontainers.image.description="Containerised Atlassian Bomboo Server"
LABEL org.opencontainers.image.description="Containerised Atlassian Bamboo Server"
LABEL maintainer="Said Sef <said@saidsef.co.uk> (saidsef.co.uk/)"
LABEL "uk.co.saidsef.bamboo"="${REF}"

Expand Down
7 changes: 4 additions & 3 deletions deployment/base/statefulset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ spec:
name: bamboo
app: bamboo
spec:
securityContext:
runAsNonRoot: true
runAsGroup: 65534
runAsUser: 65534
containers:
- image: docker.io/saidsef/atlassian-bamboo-cicd:v2023.04
imagePullPolicy: Always
Expand Down Expand Up @@ -56,9 +60,6 @@ spec:
type: RuntimeDefault
allowPrivilegeEscalation: false
privileged: false
runAsGroup: 65534
runAsUser: 65534
runAsNonRoot: true
readOnlyRootFilesystem: false
capabilities:
drop:
Expand Down

0 comments on commit ee8c882

Please sign in to comment.