Skip to content

Commit

Permalink
Update base image and start fixing manager.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Tantsur <dtantsur@protonmail.com>
  • Loading branch information
dtantsur committed Mar 20, 2024
1 parent 5c72f7f commit d2c3b0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Support FROM override
ARG BUILD_IMAGE=docker.io/golang:1.20.11@sha256:0f3cc978eb0fe87fec189c4dc74f456cd125b43cbf94fcd645e3f4bb59bcc316
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot@sha256:91ca4720011393f4d4cab3a01fa5814ee2714b7d40e6c74f2505f74168398ca9
ARG BUILD_IMAGE=docker.io/golang:1.21.7@sha256:549dd88a1a53715f177b41ab5fee25f7a376a6bb5322ac7abe263480d9554021
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot@sha256:9ecc53c269509f63c69a266168e4a687c7eb8c0cfd753bd8bfcaa4f58a90876f

# Build the manager binary
FROM $BUILD_IMAGE AS builder
Expand Down
39 changes: 8 additions & 31 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,47 +36,22 @@ spec:
labels:
control-plane: controller-manager
spec:
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
# according to the platforms which are supported by your solution.
# It is considered best practice to support multiple architectures. You can
# build your manager image using the makefile target docker-buildx.
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/arch
# operator: In
# values:
# - amd64
# - arm64
# - ppc64le
# - s390x
# - key: kubernetes.io/os
# operator: In
# values:
# - linux
securityContext:
runAsNonRoot: true
# TODO(user): For common cases that do not require escalating privileges
# it is recommended to ensure that all your Pods/Containers are restrictive.
# More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
# Please uncomment the following code if your project does NOT have to work on old Kubernetes
# versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
# seccompProfile:
# type: RuntimeDefault
containers:
- command:
- /manager
args:
- --leader-elect
# TODO(dtantsur): default to a published image
image: controller:latest
name: manager
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
privileged: false
runAsUser: 65532
runAsGroup: 65532
livenessProbe:
httpGet:
path: /healthz
Expand All @@ -89,8 +64,6 @@ spec:
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
# TODO(user): Configure the resources accordingly based on the project requirements.
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
limits:
cpu: 500m
Expand All @@ -99,4 +72,8 @@ spec:
cpu: 10m
memory: 64Mi
serviceAccountName: controller-manager
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
terminationGracePeriodSeconds: 10

0 comments on commit d2c3b0e

Please sign in to comment.