-
Notifications
You must be signed in to change notification settings - Fork 28
/
daemonset.yaml
184 lines (183 loc) · 5.8 KB
/
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
{{- if (.Values.datacollector).enable -}}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "lacework-agent.name" . }}
namespace: {{ .Release.Namespace }}
labels:
tier: monitoring
app: {{ include "lacework-agent.name" . }}
{{- with (.Values.laceworkConfig).labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with (.Values.laceworkConfig).annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
selector:
matchLabels:
name: {{ include "lacework-agent.name" . }}
template:
metadata:
{{- with (.Values.laceworkConfig).annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "lacework-agent.name" . }}
app.kubernetes.io/instance: {{ include "lacework-agent.name" . }}
name: {{ include "lacework-agent.name" . }}
{{- with (.Values.laceworkConfig).labels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
affinity:
{{ toYaml (.Values.daemonset).affinity | indent 8 }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- if or .Values.priorityClassCreate .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | default (include "lacework-agent.fullname" . ) }}
{{- end }}
{{- if (.Values.image).imagePullSecrets }}
imagePullSecrets:
{{ toYaml (.Values.image).imagePullSecrets | indent 8 }}
{{- end }}
terminationGracePeriodSeconds: 20
hostPID: true
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: lacework
image: {{ template "lacework-agent.image" . }}
imagePullPolicy: {{ (.Values.image).pullPolicy }}
{{- if not ((.Values.cloudservice).gke).autopilot }}
env:
{{- if (.Values.laceworkConfig).stdoutLogging }}
- name: LaceworkLogStdout
value: "yes"
{{- end }}
- name: LaceworkAccessToken
valueFrom:
secretKeyRef:
{{- if kindIs "string" (.Values.laceworkConfig).accessToken }}
name: {{ include "lacework-agent.name" . }}-access-token
key: agent-access-token
{{- else }}
name: {{ required "Secret name required for existing secret" (((.Values.laceworkConfig).accessToken).existingSecret).name }}
key: {{ required "Key name required for existing secret" (((.Values.laceworkConfig).accessToken).existingSecret).key }}
{{- end}}
{{- end}}
resources:
requests:
{{ toYaml (.Values.resources).requests | indent 12 }}
{{- if ((.Values.cloudservice).gke).autopilot }}
ephemeral-storage: 200Mi
{{- else }}
limits:
{{ toYaml (.Values.resources).limits | indent 12 }}
{{- end }}
securityContext:
privileged: true
runAsNonRoot: false
runAsUser: 0
readOnlyRootFilesystem: false
allowPrivilegeEscalation: true
volumeMounts:
- name: cfgmap
mountPath: /var/lib/lacework/config
{{- if ((.Values.cloudservice).gke).autopilot }}
- name: log
mountPath: /var/log/lacework
{{- else }}
- name: log
mountPath: /var/log
- name: dev
mountPath: /dev
{{- end }}
- name: sys
mountPath: /sys
- name: passwd
mountPath: /etc/passwd
readOnly: true
- name: group
mountPath: /etc/group
readOnly: true
- name: hostlacework
mountPath: /var/lib/lacework/collector
- name: hostlaceworkcontroller
mountPath: /var/lib/lacework/controller
- name: hostroot
mountPath: /laceworkfim
readOnly: true
- name: podinfo
mountPath: /etc/podinfo
{{- if kindIs "string" (.Values.laceworkConfig).serviceAccountName }}
serviceAccountName: {{ (.Values.laceworkConfig).serviceAccountName | quote }}
{{- end}}
volumes:
{{- if ((.Values.cloudservice).gke).autopilot }}
- name: log
hostPath:
path: /var/log/lacework
type: DirectoryOrCreate
- name: hostlacework
hostPath:
path: /var/autopilot/addon/lacework/collector
- name: hostlaceworkcontroller
hostPath:
path: /var/autopilot/addon/lacework/controller
{{- else }}
- name: log
hostPath:
path: /var/log
- name: hostlacework
hostPath:
path: /var/lib/lacework/collector
- name: hostlaceworkcontroller
hostPath:
path: /var/lib/lacework/controller
- name: dev
hostPath:
path: /dev
{{- end }}
- name: sys
hostPath:
path: /sys
- name: passwd
hostPath:
path: /etc/passwd
- name: group
hostPath:
path: /etc/group
- name: hostroot
hostPath:
path: /
- name: cfgmap
configMap:
defaultMode: 0640
name: lacework-config
items:
- key: config.json
path: config.json
- name: podinfo
downwardAPI:
items:
- path: "labels"
fieldRef:
fieldPath: metadata.labels
- path: "annotations"
fieldRef:
fieldPath: metadata.annotations
- path: "name"
fieldRef:
fieldPath: metadata.name
- path: "poduid"
fieldRef:
fieldPath: metadata.uid
- path: "namespace"
fieldRef:
fieldPath: metadata.namespace
updateStrategy:
{{ toYaml (.Values.daemonset).updateStrategy | indent 4 }}
{{- end }}