-
Notifications
You must be signed in to change notification settings - Fork 748
/
daemonset.yaml
203 lines (203 loc) · 6.93 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: {{ include "aws-vpc-cni.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "aws-vpc-cni.labels" . | indent 4 }}
spec:
updateStrategy:
{{ toYaml .Values.updateStrategy | indent 4 }}
selector:
matchLabels:
{{- if .Values.originalMatchLabels }}
k8s-app: aws-node
{{- else }}
app.kubernetes.io/name: {{ include "aws-vpc-cni.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 6 }}
{{- end }}
{{- end }}
template:
metadata:
{{- if .Values.podAnnotations }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "aws-vpc-cni.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
k8s-app: aws-node
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
spec:
priorityClassName: "{{ .Values.priorityClassName }}"
serviceAccountName: {{ template "aws-vpc-cni.serviceAccountName" . }}
hostNetwork: true
initContainers:
- name: aws-vpc-cni-init
image: {{ include "aws-vpc-cni.initImage" . }}
imagePullPolicy: {{ .Values.init.image.pullPolicy }}
env:
{{- range $key, $value := .Values.init.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
securityContext:
{{- toYaml .Values.init.securityContext | nindent 12 }}
{{- with default .Values.resources .Values.init.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
terminationGracePeriodSeconds: 10
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: aws-node
image: {{ include "aws-vpc-cni.image" . }}
ports:
- containerPort: 61678
name: metrics
livenessProbe:
{{ toYaml .Values.livenessProbe | indent 12 }}
timeoutSeconds: {{ .Values.livenessProbeTimeoutSeconds }}
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 12 }}
timeoutSeconds: {{ .Values.readinessProbeTimeoutSeconds }}
env:
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- with .Values.extraEnv }}
{{- toYaml .| nindent 12 }}
{{- end }}
- name: MY_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: MY_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
{{- if .Values.cniConfig.enabled }}
# The dockerfile copies the baked in config to this location, so overwrite it with ours.
# The entrypoint process will then copy our config to /host/etc/cni/net.d on boot.
- name: cni-config
mountPath: /app/10-aws.conflist
subPath: 10-aws.conflist
{{- end }}
- mountPath: /host/var/log/aws-routed-eni
name: log-dir
- mountPath: /var/run/aws-node
name: run-dir
- mountPath: /run/xtables.lock
name: xtables-lock
{{- with .Values.extraVolumeMounts }}
{{- toYaml .| nindent 10 }}
{{- end }}
{{- if .Values.nodeAgent.enabled }}
- name: aws-eks-nodeagent
image: {{ include "aws-vpc-cni.nodeAgentImage" . }}
imagePullPolicy: {{ .Values.nodeAgent.image.pullPolicy }}
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
args:
- --enable-ipv6={{ .Values.nodeAgent.enableIpv6 }}
- --enable-network-policy={{ .Values.enableNetworkPolicy }}
- --enable-cloudwatch-logs={{ .Values.nodeAgent.enableCloudWatchLogs }}
- --enable-policy-event-logs={{ .Values.nodeAgent.enablePolicyEventLogs }}
- --log-file={{ .Values.nodeAgent.networkPolicyAgentLogFileLocation }}
- --metrics-bind-addr={{ include "aws-vpc-cni.nodeAgentMetricsBindAddr" . }}
- --health-probe-bind-addr={{ include "aws-vpc-cni.nodeAgentHealthProbeBindAddr" . }}
- --conntrack-cache-cleanup-period={{ .Values.nodeAgent.conntrackCacheCleanupPeriod }}
{{- with default .Values.resources .Values.nodeAgent.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.nodeAgent.securityContext | nindent 12 }}
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
{{- if .Values.nodeAgent.enabled }}
- mountPath: /sys/fs/bpf
name: bpf-pin-path
{{- end }}
- mountPath: /var/log/aws-routed-eni
name: log-dir
- mountPath: /var/run/aws-node
name: run-dir
{{- end }}
volumes:
{{- if .Values.nodeAgent.enabled }}
- name: bpf-pin-path
hostPath:
path: /sys/fs/bpf
{{- end }}
- name: cni-bin-dir
hostPath:
path: /opt/cni/bin
- name: cni-net-dir
hostPath:
path: /etc/cni/net.d
{{- if .Values.cniConfig.enabled }}
- name: cni-config
configMap:
name: {{ include "aws-vpc-cni.fullname" . }}
{{- end }}
- name: log-dir
hostPath:
path: /var/log/aws-routed-eni
type: DirectoryOrCreate
- name: run-dir
hostPath:
path: /var/run/aws-node
type: DirectoryOrCreate
- name: xtables-lock
hostPath:
path: /run/xtables.lock
type: FileOrCreate
{{- with .Values.extraVolumes }}
{{- toYaml .| nindent 6 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}