-
Notifications
You must be signed in to change notification settings - Fork 185
/
enforcer-daemonset.yaml
157 lines (157 loc) · 4.76 KB
/
enforcer-daemonset.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ .Release.Name }}-ds
labels:
app: {{ .Release.Name }}-ds
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-ds
template:
metadata:
annotations:
{{- if not .Values.securityContext.privileged }}
container.apparmor.security.beta.kubernetes.io/enforcer: unconfined
{{- end }}
{{- if and (.Values.tolerations) (semverCompare "<1.6-0" .Capabilities.KubeVersion.GitVersion) }}
scheduler.alpha.kubernetes.io/tolerations: '{{ toJson .Values.tolerations }}'
{{- end }}
labels:
app: {{ .Release.Name }}-ds
name: {{ .Release.Name }}-ds
spec:
serviceAccount: {{ .Release.Name }}-sa
hostPID: true
containers:
- name: enforcer
image: "{{ .Values.imageCredentials.repositoryUriPrefix }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
env:
- name: SCALOCK_LOG_LEVEL
value: {{ .Values.logLevel | default "INFO" }}
{{- if .Values.enforcerTokenSecretName }}
- name: AQUA_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Values.enforcerTokenSecretName }}
key: {{ .Values.enforcerTokenSecretKey }}
{{- else }}
- name: AQUA_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-token
key: token
{{- end }}
- name: AQUA_SERVER
value: {{ .Values.gate.host | default "aqua-gateway-svc" }}:{{ .Values.gate.port | default "8443" }}
- name: AQUA_INSTALL_PATH
value: /var/lib/aquasec
{{- if .Values.enforcerLogicalName }}
- name: AQUA_LOGICAL_NAME
value: {{ .Values.enforcerLogicalName }}
{{- else }}
- name: AQUA_LOGICAL_NAME
value: {{ .Release.Name }}-helm
{{- end }}
{{- if .Values.hostRunPath }}
- name: AQUA_HOST_RUN_PATH
value: {{ .Values.hostRunPath }}
{{- end }}
{{- include "enforcer.extraEnvironmentVars" .Values | nindent 8 }}
{{- include "enforcer.extraSecretEnvironmentVars" .Values | nindent 8 }}
volumeMounts:
{{ if .Values.envoy.enabled }}
{{ if .Values.envoy.configMap }}
- name: ca-certs
mountPath: /etc/ssl/custom-certificates/
readOnly: true
{{- end }}
{{- end }}
- mountPath: /var/run
name: var-run
- mountPath: /dev
name: dev
- mountPath: /host/sys
name: sys
readOnly: true
- mountPath: /host/proc
name: proc
readOnly: true
- mountPath: /host/etc
name: etc
readOnly: true
- mountPath: /host/opt/aquasec
name: aquasec
readOnly: true
- mountPath: /opt/aquasec/tmp
name: aquasec-tmp
- mountPath: /opt/aquasec/audit
name: aquasec-audit
- mountPath: /data
name: aquasec-data
{{- with .Values.livenessProbe }}
livenessProbe:
{{ toYaml . | indent 10 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{ toYaml . | indent 10 }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
volumes:
{{- if .Values.hostRunPath }}
- name: var-run
hostPath:
path: {{ .Values.hostRunPath }}
{{- else }}
- name: var-run
hostPath:
path: /var/run
{{- end }}
- name: dev
hostPath:
path: /dev
- name: sys
hostPath:
path: /sys
- name: proc
hostPath:
path: /proc
- name: etc
hostPath:
path: /etc
- name: aquasec
hostPath:
path: /var/lib/aquasec
- name: aquasec-tmp
hostPath:
path: /var/lib/aquasec/tmp
- name: aquasec-audit
hostPath:
path: /var/lib/aquasec/audit
- name: aquasec-data
hostPath:
path: /var/lib/aquasec/data
{{ if .Values.envoy.enabled }}
{{ if .Values.envoy.configMap }}
- name: ca-certs
configMap:
name: {{ .Values.envoy.configMap }}
{{- end }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (semverCompare "^1.6-0" .Capabilities.KubeVersion.GitVersion) }}
tolerations:
{{ toYaml .Values.tolerations | indent 6 }}
{{- end }}