Skip to content

Commit

Permalink
Merge pull request #86 from camilamacedo86/solve-image
Browse files Browse the repository at this point in the history
Make image be rootless
  • Loading branch information
s-urbaniak authored Sep 15, 2020
2 parents 9738794 + 9bfdae2 commit 6615bdd
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM gcr.io/distroless/static
FROM gcr.io/distroless/static:nonroot

ARG BINARY=kube-rbac-proxy-linux-amd64
COPY _output/$BINARY /usr/local/bin/kube-rbac-proxy

EXPOSE 8080
USER 65532:65532

ENTRYPOINT ["/usr/local/bin/kube-rbac-proxy"]
4 changes: 4 additions & 0 deletions examples/non-resource-url-token-request/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -71,6 +73,8 @@ spec:
ports:
- containerPort: 8443
name: https
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
4 changes: 4 additions & 0 deletions examples/non-resource-url/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -67,6 +69,8 @@ spec:
ports:
- containerPort: 8443
name: https
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
4 changes: 4 additions & 0 deletions examples/non-resource-url/non-resource-url/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -67,6 +69,8 @@ spec:
ports:
- containerPort: 8443
name: https
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
2 changes: 2 additions & 0 deletions examples/oidc/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ spec:
ports:
- containerPort: 8444
name: https
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
4 changes: 4 additions & 0 deletions examples/resource-attributes/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -85,6 +87,8 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
4 changes: 4 additions & 0 deletions examples/rewrites/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -87,6 +89,8 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/non-resource-url-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -67,6 +69,8 @@ spec:
ports:
- containerPort: 8443
name: https
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -71,6 +73,8 @@ spec:
ports:
- containerPort: 8443
name: https
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
2 changes: 2 additions & 0 deletions scripts/templates/oidc-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ spec:
ports:
- containerPort: 8444
name: https
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/resource-attributes-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -85,6 +87,8 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/rewrites-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
labels:
app: kube-rbac-proxy
spec:
securityContext:
runAsUser: 65532
serviceAccountName: kube-rbac-proxy
containers:
- name: kube-rbac-proxy
Expand All @@ -87,6 +89,8 @@ spec:
volumeMounts:
- name: config
mountPath: /etc/kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
- name: prometheus-example-app
image: quay.io/brancz/prometheus-example-app:v0.1.0
args:
Expand Down

0 comments on commit 6615bdd

Please sign in to comment.