Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to non-root container #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM golang:1.11 as builder

RUN useradd -u 1001 kubelet-rubber-stamp

WORKDIR /src

# Add dependency and download it
Expand All @@ -17,5 +19,8 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -installsuffix cgo -o ku
FROM scratch

COPY --from=builder /src/kubelet-rubber-stamp /kubelet-rubber-stamp
COPY --from=builder /etc/passwd /etc/passwd

USER 1001

ENTRYPOINT ["/kubelet-rubber-stamp", "-logtostderr"]
2 changes: 2 additions & 0 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
labels:
name: kubelet-rubber-stamp
spec:
securityContext:
runAsUser: 1001
serviceAccountName: kubelet-rubber-stamp
tolerations:
- effect: NoSchedule
Expand Down