diff --git a/charts/kubezero-addons/Chart.yaml b/charts/kubezero-addons/Chart.yaml index 34d334f4..e8047f21 100644 --- a/charts/kubezero-addons/Chart.yaml +++ b/charts/kubezero-addons/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero-addons description: KubeZero umbrella chart for various optional cluster addons type: application -version: 0.5.2 +version: 0.5.3 appVersion: v1.22.8 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png @@ -16,7 +16,7 @@ maintainers: email: stefan@zero-downtime.net dependencies: - name: aws-node-termination-handler - version: 0.18.0 + version: 0.18.3 # repository: https://aws.github.io/eks-charts condition: aws-node-termination-handler.enabled - name: external-dns diff --git a/charts/kubezero-addons/README.md b/charts/kubezero-addons/README.md index a9c0b59b..3bcc91f8 100644 --- a/charts/kubezero-addons/README.md +++ b/charts/kubezero-addons/README.md @@ -1,6 +1,6 @@ # 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 @@ -18,7 +18,7 @@ Kubernetes: `>= 1.20.0` | 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 | # 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.enableProbesServer | bool | `true` | | | 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.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" | @@ -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.tolerations[0].effect | string | `"NoSchedule"` | | | 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.image.name | string | `"public.ecr.aws/neuron/neuron-device-plugin"` | | | awsNeuron.image.tag | string | `"1.9.0.0"` | | diff --git a/charts/kubezero-addons/charts/aws-node-termination-handler/Chart.yaml b/charts/kubezero-addons/charts/aws-node-termination-handler/Chart.yaml index 615ab0c2..22fbaebf 100644 --- a/charts/kubezero-addons/charts/aws-node-termination-handler/Chart.yaml +++ b/charts/kubezero-addons/charts/aws-node-termination-handler/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.16.0 +appVersion: 1.16.3 description: A Helm chart for the AWS Node Termination Handler. home: https://github.com/aws/eks-charts 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/eks-charts/ type: application -version: 0.18.0 +version: 0.18.3 diff --git a/charts/kubezero-addons/charts/aws-node-termination-handler/README.md b/charts/kubezero-addons/charts/aws-node-termination-handler/README.md index 43f7d488..2a1e7749 100644 --- a/charts/kubezero-addons/charts/aws-node-termination-handler/README.md +++ b/charts/kubezero-addons/charts/aws-node-termination-handler/README.md @@ -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. | `""` | | `queueURL` | Listens for messages on the specified SQS queue URL. | `""` | | `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` | -| `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 diff --git a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/_helpers.tpl b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/_helpers.tpl index 45f06f4b..3513d2a9 100644 --- a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/_helpers.tpl +++ b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/_helpers.tpl @@ -48,7 +48,6 @@ Common labels {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} -app.kubernetes.io/component: {{ .Release.Name }} app.kubernetes.io/part-of: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} helm.sh/chart: {{ include "aws-node-termination-handler.chart" . }} @@ -57,6 +56,22 @@ helm.sh/chart: {{ include "aws-node-termination-handler.chart" . }} {{- 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 */}} diff --git a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/daemonset.linux.yaml b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/daemonset.linux.yaml index 1e250e70..5fcac07e 100644 --- a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/daemonset.linux.yaml +++ b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/daemonset.linux.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "aws-node-termination-handler.fullname" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "aws-node-termination-handler.labels" . | nindent 4 }} + {{- include "aws-node-termination-handler.labelsDaemonset" . | nindent 4 }} spec: {{- with .Values.updateStrategy }} updateStrategy: diff --git a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/daemonset.windows.yaml b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/daemonset.windows.yaml index f4e2935e..f021db8b 100644 --- a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/daemonset.windows.yaml +++ b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/daemonset.windows.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "aws-node-termination-handler.fullnameWindows" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "aws-node-termination-handler.labels" . | nindent 4 }} + {{- include "aws-node-termination-handler.labelsDaemonset" . | nindent 4 }} spec: {{- with .Values.updateStrategy }} updateStrategy: diff --git a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/deployment.yaml b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/deployment.yaml index 41bf12c6..110d758d 100644 --- a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/deployment.yaml +++ b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/deployment.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "aws-node-termination-handler.fullname" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "aws-node-termination-handler.labels" . | nindent 4 }} + {{- include "aws-node-termination-handler.labelsDeployment" . | nindent 4 }} spec: replicas: {{ .Values.replicas }} {{- with .Values.strategy }} @@ -86,8 +86,8 @@ spec: value: {{ .Values.checkASGTagBeforeDraining | quote }} - name: MANAGED_ASG_TAG value: {{ .Values.managedAsgTag | quote }} - - name: ASSUME_ASG_TAG_PROPAGATION - value: {{ .Values.assumeAsgTagPropagation | quote }} + - name: USE_PROVIDER_ID + value: {{ .Values.useProviderId | quote }} - name: DRY_RUN value: {{ .Values.dryRun | quote }} - name: CORDON_ONLY @@ -137,13 +137,13 @@ spec: value: {{ .Values.webhookTemplate | quote }} {{- end }} - name: ENABLE_SPOT_INTERRUPTION_DRAINING - value: "false" + value: {{ .Values.enableSpotInterruptionDraining | quote }} - name: ENABLE_SCHEDULED_EVENT_DRAINING - value: "false" + value: {{ .Values.enableScheduledEventDraining | quote }} - name: ENABLE_REBALANCE_MONITORING - value: "false" + value: {{ .Values.enableRebalanceMonitoring | quote }} - name: ENABLE_REBALANCE_DRAINING - value: "false" + value: {{ .Values.enableRebalanceDraining | quote }} - name: ENABLE_SQS_TERMINATION_DRAINING value: "true" {{- with .Values.awsRegion }} diff --git a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/service.yaml b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/service.yaml index 1779749e..19f7b067 100644 --- a/charts/kubezero-addons/charts/aws-node-termination-handler/templates/service.yaml +++ b/charts/kubezero-addons/charts/aws-node-termination-handler/templates/service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "aws-node-termination-handler.fullname" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "aws-node-termination-handler.labels" . | nindent 4 }} + {{- include "aws-node-termination-handler.labelsDeployment" . | nindent 4 }} spec: type: ClusterIP selector: diff --git a/charts/kubezero-addons/charts/aws-node-termination-handler/values.yaml b/charts/kubezero-addons/charts/aws-node-termination-handler/values.yaml index 88491d83..9f19efd3 100644 --- a/charts/kubezero-addons/charts/aws-node-termination-handler/values.yaml +++ b/charts/kubezero-addons/charts/aws-node-termination-handler/values.yaml @@ -171,13 +171,14 @@ queueURL: "" workers: 10 # 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 # The tag to ensure is on a node if checkASGTagBeforeDraining is true managedAsgTag: "aws-node-termination-handler/managed" -# If true, assume that ASG tags will be appear on the ASG's instances -assumeAsgTagPropagation: false +# If true, fetch node name through Kubernetes node spec ProviderID instead of AWS event PrivateDnsHostname. +useProviderId: false # --------------------------------------------------------------------------------------------------------------------- # IMDS Mode diff --git a/charts/kubezero-addons/update.sh b/charts/kubezero-addons/update.sh index 9b1de651..ca00c432 100755 --- a/charts/kubezero-addons/update.sh +++ b/charts/kubezero-addons/update.sh @@ -1,6 +1,8 @@ #!/bin/bash set -ex +helm dep update + NTH_VERSION=$(yq eval '.dependencies[] | select(.name=="aws-node-termination-handler") | .version' Chart.yaml) rm -rf charts/aws-node-termination-handler diff --git a/charts/kubezero-addons/values.yaml b/charts/kubezero-addons/values.yaml index 4fa6a26b..d93f3e54 100644 --- a/charts/kubezero-addons/values.yaml +++ b/charts/kubezero-addons/values.yaml @@ -32,7 +32,10 @@ aws-node-termination-handler: # -- "aws-node-termination-handler/${ClusterName}" managedAsgTag: "aws-node-termination-handler/managed" + useProviderId: true enableSqsTerminationDraining: true + # otherwise pds fails trying to reach IMDS + enableSpotInterruptionDraining: false enableProbesServer: true deleteLocalData: true ignoreDaemonSets: true