File tree 10 files changed +47
-28
lines changed
config/helm/aws-node-termination-handler
10 files changed +47
-28
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ Parameter | Description | Default
99
99
` managedAsgTag ` | The tag to ensure is on a node if checkASGTagBeforeDraining is true | ` aws-node-termination-handler/managed `
100
100
` workers ` | The maximum amount of parallel event processors | ` 10 `
101
101
` replicas ` | The number of replicas in the NTH deployment when using queue-processor mode (NOTE: increasing replicas may cause duplicate webhooks since NTH pods are stateless) | ` 1 `
102
+ ` podDisruptionBudget ` | Limit the disruption for controller pods, requires at least 2 controller replicas | ` {} `
102
103
103
104
### AWS Node Termination Handler - IMDS Mode Configuration
104
105
Original file line number Diff line number Diff line change @@ -36,16 +36,22 @@ Name will not exceed 63 characters.
36
36
Common labels
37
37
*/} }
38
38
{ {- define " aws-node-termination-handler.labels" -} }
39
- app.kubernetes.io/name: { { include " aws-node-termination-handler.name" . } }
40
39
helm.sh/chart: { { include " aws-node-termination-handler.chart" . } }
41
- app.kubernetes.io/instance: { { .Release.Name } }
42
- k8s-app: aws-node-termination-handler
40
+ { { include " aws-node-termination-handler.selectorLabels" . } }
43
41
{ {- if .Chart.AppVersion } }
44
42
app.kubernetes.io/version: { { .Chart.AppVersion | quote } }
45
43
{ {- end } }
46
44
app.kubernetes.io/managed-by: { { .Release.Service } }
47
45
{ {- end -} }
48
46
47
+ { {/*
48
+ Selector labels
49
+ */} }
50
+ { {- define " aws-node-termination-handler.selectorLabels" -} }
51
+ app.kubernetes.io/name: { { include " aws-node-termination-handler.name" . } }
52
+ app.kubernetes.io/instance: { { .Release.Name } }
53
+ { {- end -} }
54
+
49
55
{ {/*
50
56
Create chart name and version as used by the chart label.
51
57
*/} }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ metadata:
5
5
name : {{ include "aws-node-termination-handler.fullname" . }}
6
6
namespace : {{ .Release.Namespace }}
7
7
labels :
8
- {{ include "aws-node-termination-handler.labels" . | indent 4 }}
8
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
9
9
spec :
10
10
{{- if (or .Values.updateStrategy .Values.linuxUpdateStrategy) }}
11
11
updateStrategy :
18
18
{{- end }}
19
19
selector :
20
20
matchLabels :
21
- app.kubernetes.io/name : {{ include "aws-node-termination-handler.name" . }}
22
- app.kubernetes.io/instance : {{ .Release.Name }}
21
+ {{- include "aws-node-termination-handler.selectorLabels" . | nindent 6 }}
23
22
{{ include "aws-node-termination-handler.nodeSelectorTermsOs" . }}: linux
24
23
template :
25
24
metadata :
30
29
{{- end }}
31
30
{{- end }}
32
31
labels :
33
- app.kubernetes.io/name : {{ include "aws-node-termination-handler.name" . }}
34
- app.kubernetes.io/instance : {{ .Release.Name }}
32
+ {{- include "aws-node-termination-handler.selectorLabels" . | nindent 8 }}
35
33
k8s-app : aws-node-termination-handler
36
34
{{ include "aws-node-termination-handler.nodeSelectorTermsOs" . }}: linux
37
35
{{- range $key, $value := (mergeOverwrite (dict) .Values.podLabels .Values.linuxPodLabels) }}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ metadata:
5
5
name : {{ include "aws-node-termination-handler.fullname.windows" . }}
6
6
namespace : {{ .Release.Namespace }}
7
7
labels :
8
- {{ include "aws-node-termination-handler.labels" . | indent 4 }}
8
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
9
9
spec :
10
10
{{- if (or .Values.updateStrategy .Values.windowsUpdateStrategy) }}
11
11
updateStrategy :
18
18
{{- end }}
19
19
selector :
20
20
matchLabels :
21
- app.kubernetes.io/name : {{ include "aws-node-termination-handler.name" . }}
22
- app.kubernetes.io/instance : {{ .Release.Name }}
21
+ {{- include "aws-node-termination-handler.selectorLabels" . | nindent 6 }}
23
22
{{ include "aws-node-termination-handler.nodeSelectorTermsOs" . }}: windows
24
23
template :
25
24
metadata :
30
29
{{- end }}
31
30
{{- end }}
32
31
labels :
33
- app.kubernetes.io/name : {{ include "aws-node-termination-handler.name" . }}
34
- app.kubernetes.io/instance : {{ .Release.Name }}
32
+ {{- include "aws-node-termination-handler.selectorLabels" . | nindent 8 }}
35
33
k8s-app : aws-node-termination-handler
36
34
{{ include "aws-node-termination-handler.nodeSelectorTermsOs" . }}: windows
37
35
{{- range $key, $value := (mergeOverwrite (dict) .Values.podLabels .Values.windowsPodLabels) }}
Original file line number Diff line number Diff line change @@ -5,13 +5,12 @@ metadata:
5
5
name : {{ include "aws-node-termination-handler.fullname" . }}
6
6
namespace : {{ .Release.Namespace }}
7
7
labels :
8
- {{ include "aws-node-termination-handler.labels" . | indent 4 }}
8
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
9
9
spec :
10
10
replicas : {{ .Values.replicas }}
11
11
selector :
12
12
matchLabels :
13
- app.kubernetes.io/name : {{ include "aws-node-termination-handler.name" . }}
14
- app.kubernetes.io/instance : {{ .Release.Name }}
13
+ {{- include "aws-node-termination-handler.selectorLabels" . | nindent 6 }}
15
14
{{ include "aws-node-termination-handler.nodeSelectorTermsOs" . }}: linux
16
15
template :
17
16
metadata :
20
19
{{ $key }}: {{ $value | quote }}
21
20
{{- end }}
22
21
labels :
23
- app.kubernetes.io/name : {{ include "aws-node-termination-handler.name" . }}
24
- app.kubernetes.io/instance : {{ .Release.Name }}
22
+ {{- include "aws-node-termination-handler.selectorLabels" . | nindent 8 }}
25
23
k8s-app : aws-node-termination-handler
26
24
{{ include "aws-node-termination-handler.nodeSelectorTermsOs" . }}: linux
27
25
{{- range $key, $value := .Values.podLabels }}
Original file line number Diff line number Diff line change
1
+ {{- if and .Values.enableSqsTerminationDraining (and .Values.podDisruptionBudget (gt (int .Values.replicas) 1)) }}
2
+ apiVersion : policy/v1beta1
3
+ kind : PodDisruptionBudget
4
+ metadata :
5
+ name : {{ include "aws-node-termination-handler.fullname" . }}
6
+ labels :
7
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
8
+ spec :
9
+ selector :
10
+ matchLabels :
11
+ {{- include "aws-node-termination-handler.selectorLabels" . | nindent 6 }}
12
+ {{- toYaml .Values.podDisruptionBudget | nindent 2 }}
13
+ {{- end }}
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ metadata:
9
9
namespace : {{ .Release.Namespace }}
10
10
{{- end }}
11
11
labels :
12
- {{ include "aws-node-termination-handler.labels" . | indent 4 }}
13
- {{- with .Values.podMonitor.labels }}
14
- {{ toYaml . | indent 4 }}
15
- {{- end }}
12
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
13
+ {{- with .Values.podMonitor.labels }}
14
+ {{- toYaml . | nindent 4 }}
15
+ {{- end }}
16
16
spec :
17
17
jobLabel : {{ include "aws-node-termination-handler.name" . }}
18
18
namespaceSelector :
25
25
sampleLimit : {{ .Values.podMonitor.sampleLimit }}
26
26
selector :
27
27
matchLabels :
28
- app.kubernetes.io/name : {{ include "aws-node-termination-handler.name " . }}
28
+ {{- include "aws-node-termination-handler.selectorLabels " . | nindent 6 }}
29
29
{{- end }}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ kind: PodSecurityPolicy
4
4
metadata :
5
5
name : {{ template "aws-node-termination-handler.fullname" . }}
6
6
labels :
7
- {{ include "aws-node-termination-handler.labels" . | indent 4 }}
7
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
8
8
annotations :
9
9
seccomp.security.alpha.kubernetes.io/allowedProfileNames : ' *'
10
10
spec :
@@ -38,7 +38,7 @@ metadata:
38
38
name : {{ template "aws-node-termination-handler.fullname" . }}-psp
39
39
namespace : {{ .Release.Namespace }}
40
40
labels :
41
- {{ include "aws-node-termination-handler.labels" . | indent 4 }}
41
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
42
42
rules :
43
43
- apiGroups : ['policy']
44
44
resources : ['podsecuritypolicies']
@@ -52,7 +52,7 @@ metadata:
52
52
name : {{ template "aws-node-termination-handler.fullname" . }}-psp
53
53
namespace : {{ .Release.Namespace }}
54
54
labels :
55
- {{ include "aws-node-termination-handler.labels" . | indent 4 }}
55
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
56
56
roleRef :
57
57
apiGroup : rbac.authorization.k8s.io
58
58
kind : Role
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ metadata:
6
6
namespace : {{ .Release.Namespace }}
7
7
{{- with .Values.serviceAccount.annotations }}
8
8
annotations :
9
- {{ toYaml . | indent 4 }}
9
+ {{- toYaml . | nindent 4 }}
10
10
{{- end }}
11
11
labels :
12
- {{ include "aws-node-termination-handler.labels" . | indent 4 }}
12
+ {{- include "aws-node-termination-handler.labels" . | nindent 4 }}
13
13
{{- end -}}
Original file line number Diff line number Diff line change @@ -219,3 +219,8 @@ workers: 10
219
219
220
220
# The number of replicas in the NTH deployment when using queue-processor mode (NOTE: increasing this may cause duplicate webhooks since NTH pods are stateless)
221
221
replicas : 1
222
+
223
+ # podDisruptionBudget specifies the disruption budget for the controller pods.
224
+ # Disruption budget will be configured only when the replicaCount is greater than 1
225
+ podDisruptionBudget : {}
226
+ # maxUnavailable: 1
You can’t perform that action at this time.
0 commit comments