Skip to content

Commit ddc0699

Browse files
authored
🌱 Update deployment to follow best practices (#241)
**What is the purpose of this pull request/Why do we need it?** Allow deploying the provider in a restricted namespace. **Issue #, if available:** **Description of changes:** Add required fields to pod and container security context. **Special notes for your reviewer:** https://kubernetes.io/docs/concepts/security/pod-security-standards/ **Checklist:** - [ ] Documentation updated - [ ] Unit Tests added - [ ] E2E Tests added - [x] Includes [emojis](https://github.com/kubernetes-sigs/kubebuilder-release-tools?tab=readme-ov-file#kubebuilder-project-versioning)
1 parent 9d6a608 commit ddc0699

File tree

1 file changed

+5
-29
lines changed

1 file changed

+5
-29
lines changed

config/manager/manager.yaml

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,10 @@ spec:
3737
labels:
3838
control-plane: controller-manager
3939
spec:
40-
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
41-
# according to the platforms which are supported by your solution.
42-
# It is considered best practice to support multiple architectures. You can
43-
# build your manager image using the makefile target docker-buildx.
44-
# affinity:
45-
# nodeAffinity:
46-
# requiredDuringSchedulingIgnoredDuringExecution:
47-
# nodeSelectorTerms:
48-
# - matchExpressions:
49-
# - key: kubernetes.io/arch
50-
# operator: In
51-
# values:
52-
# - amd64
53-
# - arm64
54-
# - ppc64le
55-
# - s390x
56-
# - key: kubernetes.io/os
57-
# operator: In
58-
# values:
59-
# - linux
6040
securityContext:
6141
runAsNonRoot: true
62-
# TODO(user): For common cases that do not require escalating privileges
63-
# it is recommended to ensure that all your Pods/Containers are restrictive.
64-
# More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
65-
# Please uncomment the following code if your project does NOT have to work on old Kubernetes
66-
# versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
67-
# seccompProfile:
68-
# type: RuntimeDefault
42+
seccompProfile:
43+
type: RuntimeDefault
6944
containers:
7045
- command:
7146
- /manager
@@ -82,6 +57,9 @@ spec:
8257
capabilities:
8358
drop:
8459
- "ALL"
60+
privileged: false
61+
runAsUser: 65532
62+
runAsGroup: 65532
8563
livenessProbe:
8664
httpGet:
8765
path: /healthz
@@ -94,8 +72,6 @@ spec:
9472
port: 8081
9573
initialDelaySeconds: 5
9674
periodSeconds: 10
97-
# TODO(user): Configure the resources accordingly based on the project requirements.
98-
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
9975
resources:
10076
limits:
10177
cpu: 500m

0 commit comments

Comments
 (0)