Skip to content

Commit b63f465

Browse files
committed
WZ-62986
Add namespace to serviceaccount Add openshift to values.yaml Add SecurityContextConstraints Modify deployment to use "privileged: true" when installing on openshift
1 parent 5abbda9 commit b63f465

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

wiz-outpost-lite/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ spec:
143143
resources:
144144
{{- toYaml .Values.resources | nindent 12 }}
145145
securityContext:
146+
{{- if .Values.openshift }}
147+
privileged: true
148+
{{- end }}
146149
capabilities:
147150
add:
148151
- SYS_ADMIN
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- range $values := (include "wiz-outpost-lite.runners" . | fromJson) }}
2+
{{- with merge $values (omit $ "Values") }}
3+
{{- if and .Values.openshift (eq .runner "container-registry") -}}
4+
apiVersion: security.openshift.io/v1
5+
kind: SecurityContextConstraints
6+
metadata:
7+
name: {{ include "wiz-outpost-lite.fullname" . }}-scc
8+
labels: {{- include "wiz-outpost-lite.labels" . | nindent 4 }}
9+
allowHostDirVolumePlugin: true
10+
allowPrivilegedContainer: true
11+
readOnlyRootFilesystem: false
12+
allowHostIPC: false
13+
allowHostNetwork: false
14+
allowHostPID: false
15+
allowHostPorts: false
16+
requiredDropCapabilities: null
17+
groups: []
18+
priority: 0
19+
allowedCapabilities:
20+
- SYS_ADMIN
21+
fsGroup:
22+
type: RunAsAny
23+
runAsUser:
24+
type: RunAsAny
25+
seLinuxContext:
26+
type: RunAsAny
27+
supplementalGroups:
28+
type: RunAsAny
29+
seccompProfiles:
30+
- '*'
31+
users:
32+
- system:serviceaccount:{{ .Release.Namespace }}:sa-{{ .runner }}
33+
volumes:
34+
- downwardAPI
35+
- emptyDir
36+
- hostPath
37+
- secret
38+
---
39+
{{- end }}
40+
{{- end }}
41+
{{- end }}

wiz-outpost-lite/templates/serviceaccount.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ apiVersion: v1
55
kind: ServiceAccount
66
metadata:
77
name: sa-{{ .runner }}
8+
namespace: {{ .Release.Namespace }}
89
labels:
910
{{- include "wiz-outpost-lite.labels" . | nindent 4 }}
1011
---

wiz-outpost-lite/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ httpProxyConfiguration:
7171

7272
terminationGracePeriodSeconds: 30
7373

74+
# Use when installing on OpenShift clusters to create a SecurityContextConstraint for our service-account
75+
openshift: false
76+
77+
# Use when installing on OpenShift clusters to create a Service Account for the SecurityContextConstraint
7478
serviceAccount:
7579
create: false
7680

0 commit comments

Comments
 (0)