-
Notifications
You must be signed in to change notification settings - Fork 151
/
securityContextConstraints.yaml
57 lines (56 loc) · 1.77 KB
/
securityContextConstraints.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{{/*
Default values for SecurityContextConstraints
*/}}
{{- define "splunk-otel-collector.defaultSecurityContextConstraints" -}}
priority: 10
allowHostNetwork: true
allowHostPorts: true
allowHostPID: true
allowHostDirVolumePlugin: true
allowHostIPC: false
allowPrivilegedContainer: false
volumes:
- configMap
- downwardAPI
- emptyDir
- hostPath
- secret
# Allow podman/crio socket and /proc access
seLinuxContext:
type: MustRunAs
seLinuxOptions:
user: "system_u"
role: "system_r"
type: "spc_t"
level: "s0"
allowedCapabilities: []
defaultAddCapabilities: []
fsGroup:
type: RunAsAny
readOnlyRootFilesystem: true
runAsUser:
type: RunAsAny
supplementalGroups:
type: RunAsAny
requiredDropCapabilities:
- ALL
{{- end -}}
{{- if and (eq (include "splunk-otel-collector.distribution" .) "openshift") .Values.securityContextConstraints.create }}
kind: SecurityContextConstraints
apiVersion: security.openshift.io/v1
metadata:
name: {{ template "splunk-otel-collector.serviceAccountName" . }}
labels:
{{- include "splunk-otel-collector.commonLabels" . | nindent 4 }}
app: {{ template "splunk-otel-collector.name" . }}
chart: {{ template "splunk-otel-collector.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
users:
- system:serviceaccount:{{ template "splunk-otel-collector.namespace" . }}:{{ template "splunk-otel-collector.serviceAccountName" . }}
{{- if .Values.operator.enabled }}
- system:serviceaccount:{{ include "splunk-otel-collector.namespace" . }}:{{ template "opentelemetry-operator.serviceAccountName" .Subcharts.operator }}
{{- end }}
{{- $config := include "splunk-otel-collector.defaultSecurityContextConstraints" . | fromYaml }}
{{ .Values.securityContextConstraintsOverwrite | mustMergeOverwrite $config | toYaml }}
{{- end }}