Skip to content

Commit b8c5423

Browse files
authored
update helm crd (#711)
* move Terminator CRD to 'crds' directory * remove templating from CRD
1 parent 1f9b72a commit b8c5423

File tree

3 files changed

+14
-59
lines changed

3 files changed

+14
-59
lines changed

charts/aws-node-termination-handler-2/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ helm repo add eks https://aws.github.io/eks-charts/
5757
* `serviceAccount.annotations` - Annotation names and values to add to service account. Default: `{}`.
5858
* `serviceAccount.create` - Enable creation of service account. Helm release may fail if service account already exists. Default: `true`.
5959
* `serviceAccount.name` - Name of the service account. If `serviceAccount.create` is enabled then the default will be generated from the release name and chart name. If `serviceAccount.create` is disabled then the default is `"default"`.
60-
* `terminator.defaults.drain.force` - Default value of `Terminator`'s `spec.drain.force` property. Default: `true`.
61-
* `terminator.defaults.drain.gracePeriodSeconds` - Default value of `Terminator`'s `spec.drain.gracePeriodSeconds` property. Default: `-1`.
62-
* `terminator.defaults.drain.ignoreAllDaemonSets` - Default value of `Terminator`'s `spec.drain.ignoreAllDaemonSets` property. Default: `true`.
63-
* `terminator.defaults.drain.deleteEmptyDirData` - Default value of `Terminator`'s `spec.drain.deleteEmptyDirData` property. Default: `true`.
64-
* `terminator.defaults.drain.timeoutSeconds` - Default value of `Terminator`'s `spec.drain.timeoutSeconds` property. Default: `120`.
65-
* `terminator.defaults.webhook.headers` - Default value of `Terminator`'s `spec.webhook.headers` property. Default: `[{"name": "Content-Type", "value": "application/json"}]`.
66-
* `terminator.defaults.webhook.template` - Default value of `Terminator`'s `spec.webhook.template` property. Default: `'{"text":"[NTH][Instance Interruption] EventID: {{ .EventID }} - Kind: {{ .Kind }} - Instance: {{ .InstanceID }} - Node: {{ .NodeName }} - Start Time: {{ .StartTime }}"}'`.
6760
* `webhook.env` - List of environment variables to set in the webhook container. See [core/v1 Pod.spec.containers.env](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#container-v1-core) Default: `[]`.
6861
* `webhook.image` - Image repository for the webhook controller.
6962
* `webhook.logLevel` - Override the global logging level for the webhook container. Default: `""`.

charts/aws-node-termination-handler-2/templates/node.k8s.aws_terminators.yaml renamed to charts/aws-node-termination-handler-2/crds/node.k8s.aws_terminators.yaml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,23 @@ spec:
6464
force:
6565
description: Enable termination of pods without a controller.
6666
type: boolean
67-
{{- with .Values.terminator.defaults.drain.force }}
68-
default: {{ . }}
69-
{{- end }}
67+
default: true
7068
gracePeriodSeconds:
71-
description: Wait time for pods to exit. If negative then the pod's configured gracetime will be used.
69+
description: Wait time for pods to terminate. If negative then the pod's configured gracetime will be used.
7270
type: integer
73-
{{- with .Values.terminator.defaults.drain.gracePeriodSeconds }}
74-
default: {{ . }}
75-
{{- end }}
71+
default: -1
7672
ignoreAllDaemonSets:
7773
description: Enable ignoring pods managed by a DaemonSet.
7874
type: boolean
79-
{{- with .Values.terminator.defaults.drain.ignoreAllDaemonSets }}
80-
default: {{ . }}
81-
{{- end }}
75+
default: true
8276
deleteEmptyDirData:
8377
description: Enable termination of pods with local data that will be deleted.
8478
type: boolean
85-
{{- with .Values.terminator.defaults.drain.deleteEmptyDirData }}
86-
default: {{ . }}
87-
{{- end }}
79+
default: true
8880
timeoutSeconds:
89-
description: Wait time before failing the action. If zero, wait forever.
81+
description: Wait time before failing the action. If zero, then wait forever.
9082
type: integer
91-
{{- with .Values.terminator.defaults.drain.timeoutSeconds }}
92-
default: {{ . }}
93-
{{- end }}
83+
default: 120
9484
events:
9585
description: Specify what action should be taken when a particular message type is received.
9686
type: object
@@ -155,17 +145,16 @@ spec:
155145
required:
156146
- name
157147
- value
158-
{{- with .Values.terminator.defaults.webhook.headers }}
159148
default:
160-
{{- toYaml . | nindent 22 }}
161-
{{- end }}
149+
- name: "Content-Type"
150+
value: "application/json"
162151
template:
163-
description: Used to generate the request payload.
152+
description: |
153+
Used to generate the request payload. Template used to generate webhook request body.
154+
The template may reference fields EventID, Kind, InstanceID, NodeName, and StartTime.
155+
See https://pkg.go.dev/text/template documentation for template format examples and explanation.
164156
type: string
165-
{{- with .Values.terminator.defaults.webhook.template }}
166-
default: |
167-
{{ . }}
168-
{{- end }}
157+
default: '{"text":"[NTH][Instance Interruption] EventID: {{ .EventID }} - Kind: {{ .Kind }} - Instance: {{ .InstanceID }} - Node: {{ .NodeName }} - Start Time: {{ .StartTime }}"}'
169158
status:
170159
description: TerminatorStatus defines the observed state of Terminator
171160
type: object

charts/aws-node-termination-handler-2/values.yaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -138,33 +138,6 @@ serviceAccount:
138138
annotations: {}
139139
# "eks.amazonaws.com/role-arn": <Service Account ARN>
140140

141-
terminator:
142-
defaults:
143-
drain:
144-
# Terminate pods that do not have a controller.
145-
force: true
146-
# Duration to wait for each pod to terminate. If negative then the pod's grace period will be used.
147-
gracePeriodSeconds: -1
148-
# Do not terminate pods managed by a DaemonSet.
149-
ignoreAllDaemonSets: true
150-
# Terminate pods that have local data that will be deleted.
151-
deleteEmptyDirData: true
152-
# Duration to wait before giving up. If 0, then wait forever.
153-
timeoutSeconds: 120
154-
webhook:
155-
# List of HTTP heads to include in webhook requests.
156-
headers:
157-
- name: Content-Type
158-
value: application/json
159-
# Template used to generate webhook request body. The template may reference:
160-
# * EventID
161-
# * Kind
162-
# * InstanceID
163-
# * NodeName
164-
# * StartTime
165-
# See https://pkg.go.dev/text/template documentation for template format examples and explanation.
166-
template: '{"text":"[NTH][Instance Interruption] EventID: {{ .EventID }} - Kind: {{ .Kind }} - Instance: {{ .InstanceID }} - Node: {{ .NodeName }} - Start Time: {{ .StartTime }}"}'
167-
168141
webhook:
169142
# Environment variables.
170143
env: []

0 commit comments

Comments
 (0)