-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathdeployment.yaml
More file actions
273 lines (273 loc) · 10 KB
/
Copy pathdeployment.yaml
File metadata and controls
273 lines (273 loc) · 10 KB
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "karpenter.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "karpenter.labels" . | nindent 4 }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicas }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
{{- with .Values.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "karpenter.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "karpenter.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
automountServiceAccountToken: true
serviceAccountName: {{ include "karpenter.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
{{- with .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
{{- end }}
{{- with .Values.dnsPolicy }}
dnsPolicy: {{ . }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8}}
{{- end }}
{{- if .Values.hostNetwork }}
hostNetwork: true
{{- end }}
{{- with .Values.schedulerName }}
schedulerName: {{ . | quote }}
{{- end }}
containers:
- name: {{ include "karpenter.controller.containerName" . }}
securityContext:
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 65532
runAsGroup: 65532
capabilities:
drop:
- ALL
{{- with .Values.controller.securityContext }}
{{- with .appArmorProfile }}
appArmorProfile:
{{- toYaml . | nindent 14}}
{{- end }}
{{- with .seLinuxOptions }}
seLinuxOptions:
{{- toYaml . | nindent 14}}
{{- end }}
{{- with .seccompProfile }}
seccompProfile:
{{- toYaml . | nindent 14}}
{{- end }}
{{- end }}
image: {{ include "karpenter.controller.image" . }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
env:
- name: KUBERNETES_MIN_VERSION
value: "1.19.0-0"
- name: KARPENTER_SERVICE
value: {{ include "karpenter.fullname" . }}
{{- with .Values.logLevel }}
- name: LOG_LEVEL
value: "{{ . }}"
{{- end }}
{{- with .Values.logOutputPaths }}
- name: LOG_OUTPUT_PATHS
value: "{{ join "," . }}"
{{- end }}
{{- with .Values.logErrorOutputPaths }}
- name: LOG_ERROR_OUTPUT_PATHS
value: "{{ join "," . }}"
{{- end }}
- name: METRICS_PORT
value: "{{ .Values.controller.metrics.port }}"
- name: HEALTH_PROBE_PORT
value: "{{ .Values.controller.healthProbe.port }}"
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CPU_REQUESTS
valueFrom:
resourceFieldRef:
containerName: {{ include "karpenter.controller.containerName" . }}
divisor: 1m
resource: requests.cpu
- name: MEMORY_LIMIT
valueFrom:
resourceFieldRef:
containerName: {{ include "karpenter.controller.containerName" . }}
divisor: "0"
resource: limits.memory
- name: FEATURE_GATES
value: "ReservedCapacity={{ .Values.settings.featureGates.reservedCapacity }},SpotToSpotConsolidation={{ .Values.settings.featureGates.spotToSpotConsolidation }},NodeRepair={{ .Values.settings.featureGates.nodeRepair }},NodeOverlay={{ .Values.settings.featureGates.nodeOverlay }},StaticCapacity={{ .Values.settings.featureGates.staticCapacity }}"
{{- with .Values.settings.batchMaxDuration }}
- name: BATCH_MAX_DURATION
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.batchIdleDuration }}
- name: BATCH_IDLE_DURATION
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.preferencePolicy }}
- name: PREFERENCE_POLICY
value: "{{ . }}"
{{- end }}
{{- with .Values.settings.minValuesPolicy }}
- name: MIN_VALUES_POLICY
value: "{{ . }}"
{{- end }}
{{- with .Values.settings.clusterCABundle }}
- name: CLUSTER_CA_BUNDLE
value: "{{ tpl (toString .) $ }}"
{{- end }}
- name: CLUSTER_NAME
value: "{{ required "Chart cannot be installed without a valid settings.clusterName!" (tpl .Values.settings.clusterName .) }}"
{{- with .Values.settings.clusterEndpoint }}
- name: CLUSTER_ENDPOINT
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.isolatedVPC }}
- name: ISOLATED_VPC
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.eksControlPlane }}
- name: EKS_CONTROL_PLANE
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.vmMemoryOverheadPercent }}
- name: VM_MEMORY_OVERHEAD_PERCENT
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.interruptionQueue }}
- name: INTERRUPTION_QUEUE
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.reservedENIs }}
- name: RESERVED_ENIS
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.ignoreDRARequests }}
- name: IGNORE_DRA_REQUESTS
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.disableClusterStateObservability }}
- name: DISABLE_CLUSTER_STATE_OBSERVABILITY
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.disableDryRun }}
- name: DISABLE_DRY_RUN
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.subnetRefreshInterval }}
- name: SUBNET_REFRESH_INTERVAL
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.settings.securityGroupRefreshInterval }}
- name: SECURITY_GROUP_REFRESH_INTERVAL
value: "{{ tpl (toString .) $ }}"
{{- end }}
{{- with .Values.controller.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.controller.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http-metrics
containerPort: {{ .Values.controller.metrics.port }}
protocol: TCP
- name: http
containerPort: {{ .Values.controller.healthProbe.port }}
protocol: TCP
livenessProbe:
initialDelaySeconds: 30
timeoutSeconds: 30
httpGet:
path: /healthz
port: http
readinessProbe:
initialDelaySeconds: 5
timeoutSeconds: 30
httpGet:
path: /readyz
port: http
{{- with .Values.controller.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.controller.extraVolumeMounts }}
volumeMounts:
{{- with .Values.controller.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- range .Values.controller.sidecarContainer }}
- {{- toYaml . | nindent 10 }}
{{- if or $.Values.controller.extraVolumeMounts $.Values.controller.sidecarVolumeMounts }}
volumeMounts:
{{- with $.Values.controller.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.controller.sidecarVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
# The template below patches the .Values.affinity to add a default label selector where not specificed
{{- $_ := include "karpenter.patchAffinity" $ }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
# The template below patches the .Values.topologySpreadConstraints to add a default label selector where not specificed
{{- $_ := include "karpenter.patchTopologySpreadConstraints" $ }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.extraVolumes }}
volumes:
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}