forked from cloudpilot-ai/karpenter-provider-alibabacloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
140 lines (140 loc) · 4.88 KB
/
deployment.yaml
File metadata and controls
140 lines (140 loc) · 4.88 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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "karpenter.fullname" . }}
labels:
{{- include "karpenter.labels" . | nindent 4 }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.controller.replicaCount }}
revisionHistoryLimit: {{ .Values.controller.revisionHistoryLimit }}
{{- with .Values.controller.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "karpenter.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "karpenter.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.controller.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "karpenter.serviceAccountName" . }}
{{- with .Values.controller.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
{{- with .Values.controller.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
{{- end }}
containers:
- name: karpenter
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}"
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
env:
- name: HEALTH_PROBE_PORT
value: "{{ .Values.controller.healthProbe.port }}"
- name: CLUSTER_ID
value: {{ .Values.controller.settings.clusterID }}
- name: TELEMETRY_SHARE
value: "{{ .Values.controller.settings.telemetryShare }}"
- name: KUBERNETES_MIN_VERSION
value: "1.26.0"
{{- 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: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: LEADER_ELECTION_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MEMORY_LIMIT
valueFrom:
resourceFieldRef:
containerName: karpenter
divisor: "0"
resource: limits.memory
- name: FEATURE_GATES
value: "SpotToSpotConsolidation={{ .Values.controller.featureGates.spotToSpotConsolidation }}"
{{- with .Values.controller.settings.batchMaxDuration }}
- name: BATCH_MAX_DURATION
value: "{{ . }}"
{{- end }}
{{- with .Values.controller.settings.batchIdleDuration }}
- name: BATCH_IDLE_DURATION
value: "{{ . }}"
{{- end }}
{{- with .Values.controller.settings.vmMemoryOverheadPercent }}
- name: VM_MEMORY_OVERHEAD_PERCENT
value: "{{ . }}"
{{- end }}
- name: METRICS_PORT
value: "{{ .Values.controller.metrics.port }}"
- name: KARPENTER_SERVICE
value: {{ include "karpenter.fullname" . }}
ports:
- name: http
containerPort: {{ .Values.controller.healthProbe.port }}
protocol: TCP
- name: http-metrics
containerPort: {{ .Values.controller.metrics.port }}
protocol: TCP
livenessProbe:
initialDelaySeconds: 30
timeoutSeconds: 30
httpGet:
path: /healthz
port: http
readinessProbe:
initialDelaySeconds: 5
timeoutSeconds: 30
httpGet:
path: /readyz
port: http
resources:
{{- toYaml .Values.controller.resources | nindent 12 }}
volumeMounts:
- mountPath: "/home/nonroot/.aliyun/"
readOnly: true
name: alibabacloud-secret
{{- with .Values.controller.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: alibabacloud-secret
secret:
secretName: {{ include "karpenter.fullname" . }}-alibabacloud-credentials
items:
- key: config.json
path: "config.json"