feat: aws-node-termination-handler version bump, use providerID rather than nodename

This commit is contained in:
Stefan Reimer 2022-05-16 10:14:02 +02:00
parent f8f4e43d1c
commit 6560f3be85
12 changed files with 44 additions and 21 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: kubezero-addons name: kubezero-addons
description: KubeZero umbrella chart for various optional cluster addons description: KubeZero umbrella chart for various optional cluster addons
type: application type: application
version: 0.5.2 version: 0.5.3
appVersion: v1.22.8 appVersion: v1.22.8
home: https://kubezero.com home: https://kubezero.com
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png
@ -16,7 +16,7 @@ maintainers:
email: stefan@zero-downtime.net email: stefan@zero-downtime.net
dependencies: dependencies:
- name: aws-node-termination-handler - name: aws-node-termination-handler
version: 0.18.0 version: 0.18.3
# repository: https://aws.github.io/eks-charts # repository: https://aws.github.io/eks-charts
condition: aws-node-termination-handler.enabled condition: aws-node-termination-handler.enabled
- name: external-dns - name: external-dns

View File

@ -1,6 +1,6 @@
# kubezero-addons # kubezero-addons
![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.22.8](https://img.shields.io/badge/AppVersion-v1.22.8-informational?style=flat-square) ![Version: 0.5.3](https://img.shields.io/badge/Version-0.5.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.22.8](https://img.shields.io/badge/AppVersion-v1.22.8-informational?style=flat-square)
KubeZero umbrella chart for various optional cluster addons KubeZero umbrella chart for various optional cluster addons
@ -18,7 +18,7 @@ Kubernetes: `>= 1.20.0`
| Repository | Name | Version | | Repository | Name | Version |
|------------|------|---------| |------------|------|---------|
| | aws-node-termination-handler | 0.18.0 | | | aws-node-termination-handler | 0.18.3 |
| https://kubernetes-sigs.github.io/external-dns/ | external-dns | 1.7.1 | | https://kubernetes-sigs.github.io/external-dns/ | external-dns | 1.7.1 |
# MetalLB # MetalLB
@ -36,6 +36,7 @@ Device plugin for [AWS Neuron](https://aws.amazon.com/machine-learning/neuron/)
| aws-node-termination-handler.emitKubernetesEvents | bool | `true` | | | aws-node-termination-handler.emitKubernetesEvents | bool | `true` | |
| aws-node-termination-handler.enableProbesServer | bool | `true` | | | aws-node-termination-handler.enableProbesServer | bool | `true` | |
| aws-node-termination-handler.enablePrometheusServer | bool | `false` | | | aws-node-termination-handler.enablePrometheusServer | bool | `false` | |
| aws-node-termination-handler.enableSpotInterruptionDraining | bool | `false` | |
| aws-node-termination-handler.enableSqsTerminationDraining | bool | `true` | | | aws-node-termination-handler.enableSqsTerminationDraining | bool | `true` | |
| aws-node-termination-handler.enabled | bool | `false` | | | aws-node-termination-handler.enabled | bool | `false` | |
| aws-node-termination-handler.extraEnv[0] | object | `{"name":"AWS_ROLE_ARN","value":""}` | "arn:aws:iam::${AWS::AccountId}:role/${AWS::Region}.${ClusterName}.awsNth" | | aws-node-termination-handler.extraEnv[0] | object | `{"name":"AWS_ROLE_ARN","value":""}` | "arn:aws:iam::${AWS::AccountId}:role/${AWS::Region}.${ClusterName}.awsNth" |
@ -55,6 +56,7 @@ Device plugin for [AWS Neuron](https://aws.amazon.com/machine-learning/neuron/)
| aws-node-termination-handler.taintNode | bool | `true` | | | aws-node-termination-handler.taintNode | bool | `true` | |
| aws-node-termination-handler.tolerations[0].effect | string | `"NoSchedule"` | | | aws-node-termination-handler.tolerations[0].effect | string | `"NoSchedule"` | |
| aws-node-termination-handler.tolerations[0].key | string | `"node-role.kubernetes.io/master"` | | | aws-node-termination-handler.tolerations[0].key | string | `"node-role.kubernetes.io/master"` | |
| aws-node-termination-handler.useProviderId | bool | `true` | |
| awsNeuron.enabled | bool | `false` | | | awsNeuron.enabled | bool | `false` | |
| awsNeuron.image.name | string | `"public.ecr.aws/neuron/neuron-device-plugin"` | | | awsNeuron.image.name | string | `"public.ecr.aws/neuron/neuron-device-plugin"` | |
| awsNeuron.image.tag | string | `"1.9.0.0"` | | | awsNeuron.image.tag | string | `"1.9.0.0"` | |

View File

@ -1,5 +1,5 @@
apiVersion: v2 apiVersion: v2
appVersion: 1.16.0 appVersion: 1.16.3
description: A Helm chart for the AWS Node Termination Handler. description: A Helm chart for the AWS Node Termination Handler.
home: https://github.com/aws/eks-charts home: https://github.com/aws/eks-charts
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
@ -22,4 +22,4 @@ sources:
- https://github.com/aws/aws-node-termination-handler/ - https://github.com/aws/aws-node-termination-handler/
- https://github.com/aws/eks-charts/ - https://github.com/aws/eks-charts/
type: application type: application
version: 0.18.0 version: 0.18.3

View File

@ -110,9 +110,9 @@ The configuration in this table applies to AWS Node Termination Handler in queue
| `awsRegion` | If specified, use the AWS region for AWS API calls, else NTH will try to find the region through the `AWS_REGION` environment variable, IMDS, or the specified queue URL. | `""` | | `awsRegion` | If specified, use the AWS region for AWS API calls, else NTH will try to find the region through the `AWS_REGION` environment variable, IMDS, or the specified queue URL. | `""` |
| `queueURL` | Listens for messages on the specified SQS queue URL. | `""` | | `queueURL` | Listens for messages on the specified SQS queue URL. | `""` |
| `workers` | The maximum amount of parallel event processors to handle concurrent events. | `10` | | `workers` | The maximum amount of parallel event processors to handle concurrent events. | `10` |
| `checkASGTagBeforeDraining` | If `true`, check that the instance is tagged with the `managedAsgTag` before draining the node. | `true` | | `checkASGTagBeforeDraining` | If `true`, check that the instance is tagged with the `managedAsgTag` before draining the node. If `false`, disables calls ASG API. | `true` |
| `managedAsgTag` | The node tag to check if `checkASGTagBeforeDraining` is `true`. | `aws-node-termination-handler/managed` | | `managedAsgTag` | The node tag to check if `checkASGTagBeforeDraining` is `true`. | `aws-node-termination-handler/managed` |
| `assumeAsgTagPropagation` | If `true`, assume that ASG tags will be appear on the ASG's instances. | `false` | | `useProviderId` | If `true`, fetch node name through Kubernetes node spec ProviderID instead of AWS event PrivateDnsHostname. | `false` |
### IMDS Mode Configuration ### IMDS Mode Configuration

View File

@ -48,7 +48,6 @@ Common labels
{{- if .Chart.AppVersion }} {{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }} {{- end }}
app.kubernetes.io/component: {{ .Release.Name }}
app.kubernetes.io/part-of: {{ .Release.Name }} app.kubernetes.io/part-of: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "aws-node-termination-handler.chart" . }} helm.sh/chart: {{ include "aws-node-termination-handler.chart" . }}
@ -57,6 +56,22 @@ helm.sh/chart: {{ include "aws-node-termination-handler.chart" . }}
{{- end }} {{- end }}
{{- end -}} {{- end -}}
{{/*
Deployment labels
*/}}
{{- define "aws-node-termination-handler.labelsDeployment" -}}
{{ include "aws-node-termination-handler.labels" . }}
app.kubernetes.io/component: deployment
{{- end -}}
{{/*
Daemonset labels
*/}}
{{- define "aws-node-termination-handler.labelsDaemonset" -}}
{{ include "aws-node-termination-handler.labels" . }}
app.kubernetes.io/component: daemonset
{{- end -}}
{{/* {{/*
Selector labels Selector labels
*/}} */}}

View File

@ -5,7 +5,7 @@ metadata:
name: {{ include "aws-node-termination-handler.fullname" . }} name: {{ include "aws-node-termination-handler.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "aws-node-termination-handler.labels" . | nindent 4 }} {{- include "aws-node-termination-handler.labelsDaemonset" . | nindent 4 }}
spec: spec:
{{- with .Values.updateStrategy }} {{- with .Values.updateStrategy }}
updateStrategy: updateStrategy:

View File

@ -5,7 +5,7 @@ metadata:
name: {{ include "aws-node-termination-handler.fullnameWindows" . }} name: {{ include "aws-node-termination-handler.fullnameWindows" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "aws-node-termination-handler.labels" . | nindent 4 }} {{- include "aws-node-termination-handler.labelsDaemonset" . | nindent 4 }}
spec: spec:
{{- with .Values.updateStrategy }} {{- with .Values.updateStrategy }}
updateStrategy: updateStrategy:

View File

@ -5,7 +5,7 @@ metadata:
name: {{ include "aws-node-termination-handler.fullname" . }} name: {{ include "aws-node-termination-handler.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "aws-node-termination-handler.labels" . | nindent 4 }} {{- include "aws-node-termination-handler.labelsDeployment" . | nindent 4 }}
spec: spec:
replicas: {{ .Values.replicas }} replicas: {{ .Values.replicas }}
{{- with .Values.strategy }} {{- with .Values.strategy }}
@ -86,8 +86,8 @@ spec:
value: {{ .Values.checkASGTagBeforeDraining | quote }} value: {{ .Values.checkASGTagBeforeDraining | quote }}
- name: MANAGED_ASG_TAG - name: MANAGED_ASG_TAG
value: {{ .Values.managedAsgTag | quote }} value: {{ .Values.managedAsgTag | quote }}
- name: ASSUME_ASG_TAG_PROPAGATION - name: USE_PROVIDER_ID
value: {{ .Values.assumeAsgTagPropagation | quote }} value: {{ .Values.useProviderId | quote }}
- name: DRY_RUN - name: DRY_RUN
value: {{ .Values.dryRun | quote }} value: {{ .Values.dryRun | quote }}
- name: CORDON_ONLY - name: CORDON_ONLY
@ -137,13 +137,13 @@ spec:
value: {{ .Values.webhookTemplate | quote }} value: {{ .Values.webhookTemplate | quote }}
{{- end }} {{- end }}
- name: ENABLE_SPOT_INTERRUPTION_DRAINING - name: ENABLE_SPOT_INTERRUPTION_DRAINING
value: "false" value: {{ .Values.enableSpotInterruptionDraining | quote }}
- name: ENABLE_SCHEDULED_EVENT_DRAINING - name: ENABLE_SCHEDULED_EVENT_DRAINING
value: "false" value: {{ .Values.enableScheduledEventDraining | quote }}
- name: ENABLE_REBALANCE_MONITORING - name: ENABLE_REBALANCE_MONITORING
value: "false" value: {{ .Values.enableRebalanceMonitoring | quote }}
- name: ENABLE_REBALANCE_DRAINING - name: ENABLE_REBALANCE_DRAINING
value: "false" value: {{ .Values.enableRebalanceDraining | quote }}
- name: ENABLE_SQS_TERMINATION_DRAINING - name: ENABLE_SQS_TERMINATION_DRAINING
value: "true" value: "true"
{{- with .Values.awsRegion }} {{- with .Values.awsRegion }}

View File

@ -5,7 +5,7 @@ metadata:
name: {{ include "aws-node-termination-handler.fullname" . }} name: {{ include "aws-node-termination-handler.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "aws-node-termination-handler.labels" . | nindent 4 }} {{- include "aws-node-termination-handler.labelsDeployment" . | nindent 4 }}
spec: spec:
type: ClusterIP type: ClusterIP
selector: selector:

View File

@ -171,13 +171,14 @@ queueURL: ""
workers: 10 workers: 10
# If true, check that the instance is tagged with "aws-node-termination-handler/managed" as the key before draining the node # If true, check that the instance is tagged with "aws-node-termination-handler/managed" as the key before draining the node
# If false, disables calls to ASG API.
checkASGTagBeforeDraining: true checkASGTagBeforeDraining: true
# The tag to ensure is on a node if checkASGTagBeforeDraining is true # The tag to ensure is on a node if checkASGTagBeforeDraining is true
managedAsgTag: "aws-node-termination-handler/managed" managedAsgTag: "aws-node-termination-handler/managed"
# If true, assume that ASG tags will be appear on the ASG's instances # If true, fetch node name through Kubernetes node spec ProviderID instead of AWS event PrivateDnsHostname.
assumeAsgTagPropagation: false useProviderId: false
# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------
# IMDS Mode # IMDS Mode

View File

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
set -ex set -ex
helm dep update
NTH_VERSION=$(yq eval '.dependencies[] | select(.name=="aws-node-termination-handler") | .version' Chart.yaml) NTH_VERSION=$(yq eval '.dependencies[] | select(.name=="aws-node-termination-handler") | .version' Chart.yaml)
rm -rf charts/aws-node-termination-handler rm -rf charts/aws-node-termination-handler

View File

@ -32,7 +32,10 @@ aws-node-termination-handler:
# -- "aws-node-termination-handler/${ClusterName}" # -- "aws-node-termination-handler/${ClusterName}"
managedAsgTag: "aws-node-termination-handler/managed" managedAsgTag: "aws-node-termination-handler/managed"
useProviderId: true
enableSqsTerminationDraining: true enableSqsTerminationDraining: true
# otherwise pds fails trying to reach IMDS
enableSpotInterruptionDraining: false
enableProbesServer: true enableProbesServer: true
deleteLocalData: true deleteLocalData: true
ignoreDaemonSets: true ignoreDaemonSets: true