Skip to content

Commit

Permalink
Merge pull request #285 from fluxcd/fsGroup
Browse files Browse the repository at this point in the history
Add fsGroup to pod security context
  • Loading branch information
stefanprodan committed Feb 8, 2021
2 parents 0465b12 + 9764598 commit a55a714
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY internal/ internal/
# build without specifing the arch
RUN CGO_ENABLED=1 go build -o source-controller main.go

FROM alpine:3.12
FROM alpine:3.13

# link repo to the GitHub Container Registry image
LABEL org.opencontainers.image.source="https://github.com/fluxcd/source-controller"
Expand All @@ -44,7 +44,7 @@ COPY --from=builder /workspace/source-controller /usr/local/bin/
# https://github.com/gliderlabs/docker-alpine/issues/367#issuecomment-354316460
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

RUN addgroup -S controller && adduser -S -g controller controller
RUN addgroup -S controller && adduser -S controller -G controller

USER controller

Expand Down
4 changes: 4 additions & 0 deletions config/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ spec:
prometheus.io/port: "8080"
spec:
terminationGracePeriodSeconds: 10
# Required for AWS IAM Role bindings
# https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html
securityContext:
fsGroup: 1337
containers:
- name: manager
image: fluxcd/source-controller
Expand Down

0 comments on commit a55a714

Please sign in to comment.