Skip to content

Commit

Permalink
Merge branch 'master' of github.com:resmoio/kubernetes-event-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaakin committed Jul 6, 2023
2 parents 600b2cf + b7a82d3 commit 74077be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN CGO_ENABLED=0 GOOS=linux GO11MODULE=on go build -a -o /main .
FROM gcr.io/distroless/static:nonroot
COPY --from=builder --chown=nonroot:nonroot /main /kubernetes-event-exporter

USER nonroot
# https://github.com/GoogleContainerTools/distroless/blob/main/base/base.bzl#L8C1-L9C1
USER 65532

ENTRYPOINT ["/kubernetes-event-exporter"]
2 changes: 2 additions & 0 deletions deploy/00-roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: Namespace
metadata:
name: monitoring
labels:
pod-security.kubernetes.io/restricted: enforce
---
apiVersion: v1
kind: ServiceAccount
Expand Down
8 changes: 8 additions & 0 deletions deploy/02-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ spec:
prometheus.io/path: '/metrics'
spec:
serviceAccountName: event-exporter
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: event-exporter
# The good practice would be to pin the version. This is just a reference so that we don't
Expand All @@ -27,6 +31,10 @@ spec:
volumeMounts:
- mountPath: /data
name: cfg
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
volumes:
- name: cfg
configMap:
Expand Down

0 comments on commit 74077be

Please sign in to comment.