Skip to content

Commit 1ec8a5f

Browse files
JustinKuliopenshift-merge-robot
authored andcommitted
Use consistent security contexts in all containers
Things were slightly inconsistent, which could cause problems over different kubernetes versions, especially with recent-ish changes in k8s regarding Pod Security Admission Control. Refs: - https://issues.redhat.com/browse/ACM-5352 - https://issues.redhat.com/browse/ACM-4590 Signed-off-by: Justin Kulikauskas <[email protected]>
1 parent 017e8fb commit 1ec8a5f

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

pkg/addon/configpolicy/manifests/managedclusterchart/templates/deployment.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ spec:
5151
- mountPath: "/var/run/metrics-cert"
5252
name: metrics-cert
5353
readOnly: true
54+
securityContext:
55+
allowPrivilegeEscalation: false
56+
capabilities:
57+
drop:
58+
- ALL
59+
privileged: false
60+
readOnlyRootFilesystem: true
5461
{{- end }}
5562
- name: {{ .Chart.Name }}
5663
image: "{{ .Values.global.imageOverrides.config_policy_controller }}"
@@ -131,12 +138,6 @@ spec:
131138
containerPort: 8383
132139
{{- end }}
133140
resources: {{- toYaml .Values.resources | nindent 10 }}
134-
allowPrivilegeEscalation: false
135-
capabilities:
136-
drop:
137-
- ALL
138-
privileged: false
139-
readOnlyRootFilesystem: true
140141
volumeMounts:
141142
- name: klusterlet-config
142143
mountPath: /var/run/klusterlet
@@ -145,6 +146,13 @@ spec:
145146
name: managed-kubeconfig-secret
146147
readOnly: true
147148
{{- end }}
149+
securityContext:
150+
allowPrivilegeEscalation: false
151+
capabilities:
152+
drop:
153+
- ALL
154+
privileged: false
155+
readOnlyRootFilesystem: true
148156
volumes:
149157
- name: klusterlet-config
150158
secret:

pkg/addon/policyframework/manifests/managedclusterchart/templates/deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ spec:
5151
- mountPath: "/var/run/metrics-cert"
5252
name: metrics-cert
5353
readOnly: true
54+
securityContext:
55+
allowPrivilegeEscalation: false
56+
capabilities:
57+
drop:
58+
- ALL
59+
privileged: false
60+
readOnlyRootFilesystem: true
5461
{{- end }}
5562
- name: governance-policy-framework-addon
5663
image: "{{ .Values.global.imageOverrides.governance_policy_framework_addon }}"

0 commit comments

Comments
 (0)