Skip to content

Commit 0676956

Browse files
authored
Merge pull request #186 from winston0410/feat/make-controller-non-root
make controller deployment run as nobody and nogroup
2 parents 699a9c0 + 9cf6d3a commit 0676956

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

config/default/manager_auth_proxy_patch.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ spec:
2020
- containerPort: 8443
2121
protocol: TCP
2222
name: https
23+
securityContext:
24+
runAsNonRoot: false
25+
runAsGroup: 65534
26+
runAsUser: 65534
27+
allowPrivilegeEscalation: false
28+
readOnlyRootFilesystem: true
29+
capabilities:
30+
drop:
31+
- ALL
2332
resources:
2433
limits:
2534
cpu: 500m

config/default/manager_auth_proxy_patch.yaml.template

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ spec:
2020
- containerPort: 8443
2121
protocol: TCP
2222
name: https
23+
securityContext:
24+
runAsNonRoot: false
25+
runAsGroup: 65534
26+
runAsUser: 65534
27+
allowPrivilegeEscalation: false
28+
readOnlyRootFilesystem: true
29+
capabilities:
30+
drop:
31+
- ALL
2332
resources:
2433
limits:
2534
cpu: 500m

config/manager/manager.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ spec:
2525
control-plane: controller-manager
2626
spec:
2727
securityContext:
28+
fsGroup: 65534
2829
runAsNonRoot: true
2930
containers:
3031
- command:
@@ -34,7 +35,14 @@ spec:
3435
image: controller:latest
3536
name: manager
3637
securityContext:
38+
runAsNonRoot: false
39+
runAsGroup: 65534
40+
runAsUser: 65534
3741
allowPrivilegeEscalation: false
42+
readOnlyRootFilesystem: true
43+
capabilities:
44+
drop:
45+
- ALL
3846
livenessProbe:
3947
httpGet:
4048
path: /healthz

0 commit comments

Comments
 (0)