Skip to content

Commit a55a714

Browse files
authored
Merge pull request #285 from fluxcd/fsGroup
Add fsGroup to pod security context
2 parents 0465b12 + 9764598 commit a55a714

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COPY internal/ internal/
2929
# build without specifing the arch
3030
RUN CGO_ENABLED=1 go build -o source-controller main.go
3131

32-
FROM alpine:3.12
32+
FROM alpine:3.13
3333

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

47-
RUN addgroup -S controller && adduser -S -g controller controller
47+
RUN addgroup -S controller && adduser -S controller -G controller
4848

4949
USER controller
5050

config/manager/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ spec:
2020
prometheus.io/port: "8080"
2121
spec:
2222
terminationGracePeriodSeconds: 10
23+
# Required for AWS IAM Role bindings
24+
# https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html
25+
securityContext:
26+
fsGroup: 1337
2327
containers:
2428
- name: manager
2529
image: fluxcd/source-controller

0 commit comments

Comments
 (0)