From 7a70883e25205e8584853eda3c557e343b47fba9 Mon Sep 17 00:00:00 2001 From: Tiationg Kho Date: Fri, 21 Feb 2025 01:03:23 -0800 Subject: [PATCH 1/2] Add k8s 1.32 support --- .github/workflows/build-and-test.yaml | 2 +- Makefile | 2 +- README.md | 19 +++++++++---------- scripts/generate-k8s-yaml | 4 ++-- .../run-k8s-compatibility-test.sh | 4 ++-- test/k8s-local-cluster-test/provision-cluster | 10 ++++++---- test/k8s-local-cluster-test/run-test | 4 ++-- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index f6246c94..52f02bff 100755 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -191,7 +191,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - k8sVersion: ["1.29", "1.30", "1.31"] + k8sVersion: ["1.29", "1.30", "1.31", "1.32"] steps: - name: Set up Go 1.x uses: actions/setup-go@v2 diff --git a/Makefile b/Makefile index 0fd925be..72d6183f 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ upload-resources-to-github-windows: generate-k8s-yaml: ${MAKEFILE_PATH}/scripts/generate-k8s-yaml - ${MAKEFILE_PATH}/scripts/generate-k8s-yaml -k "1.31.2" -s ${K8S_1_25_ASSET_SUFFIX} + ${MAKEFILE_PATH}/scripts/generate-k8s-yaml -k "1.32.2" -s ${K8S_1_25_ASSET_SUFFIX} sync-readme-to-ecr-public: @ECR_REGISTRY=${ECR_REGISTRY} ${MAKEFILE_PATH}/scripts/ecr-public-login diff --git a/README.md b/README.md index 8071b34a..a5b21fcc 100644 --- a/README.md +++ b/README.md @@ -164,16 +164,15 @@ helm upgrade --install aws-node-termination-handler \ ### Kubernetes Compatibility -| NTH Release | K8s v1.31 | K8s v1.30 | K8s v1.29 | K8s v1.28 | K8s v1.27 | K8s v1.26 | K8s v1.25 | K8s v1.24 | K8s v1.23 | -| :-----------------------------------------------------------------------------------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | -| [v1.24.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.24.0) | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | -| [v1.23.1](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.23.1) | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | -| [v1.23.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.23.0) | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [v1.22.1](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.22.1) | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [v1.22.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.22.0) | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [v1.21.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.21.0) | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [v1.20.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.20.0) | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [v1.19.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.19.0) | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | +| NTH Release | K8s v1.32 | K8s v1.31 | K8s v1.30 | K8s v1.29 | K8s v1.28 | K8s v1.27 | K8s v1.26 | K8s v1.25 | +| :-----------------------------------------------------------------------------------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | +| [v1.24.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.24.0) | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | +| [v1.23.1](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.23.1) | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | +| [v1.23.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.23.0) | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [v1.22.1](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.22.1) | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [v1.22.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.22.0) | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [v1.21.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.21.0) | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [v1.20.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.20.0) | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | A ✅ indicates that a specific aws-node-termination-handler release has been tested with a specific Kubernetes version. A ❌ indicates that a specific aws-node-termination-handler release has not been tested with a specific Kubernetes version. diff --git a/scripts/generate-k8s-yaml b/scripts/generate-k8s-yaml index 85d51bdb..d264851d 100755 --- a/scripts/generate-k8s-yaml +++ b/scripts/generate-k8s-yaml @@ -7,9 +7,9 @@ VERSION=$(make -s -f $MAKEFILEPATH version) BUILD_DIR=$SCRIPTPATH/../build/k8s-resources/$VERSION PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') -HELM_VERSION="3.16.2" +HELM_VERSION="3.17.1" NAMESPACE="kube-system" -K8S_VERSION="1.31.2" +K8S_VERSION="1.32.2" SUFFIX="" USAGE=$(cat << EOM diff --git a/test/k8s-compatibility-test/run-k8s-compatibility-test.sh b/test/k8s-compatibility-test/run-k8s-compatibility-test.sh index 148395f9..21f9bd43 100755 --- a/test/k8s-compatibility-test/run-k8s-compatibility-test.sh +++ b/test/k8s-compatibility-test/run-k8s-compatibility-test.sh @@ -2,14 +2,14 @@ set -euo pipefail SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" -versions=("1.29" "1.30" "1.31") +versions=("1.29" "1.30" "1.31" "1.32") E_CODE=0 AFTER_FIRST_RUN_ARGS="" PASS_THRU_ARGS="" USAGE=$(cat << 'EOM' Usage: run-k8s-compatability-test [-h] - Executes the spot termination integration test for each version of kubernetes (k8s 1.29 - 1.31 supported) + Executes the spot termination integration test for each version of kubernetes (k8s 1.29 - 1.32 supported) Examples: # run test with direct download of go modules diff --git a/test/k8s-local-cluster-test/provision-cluster b/test/k8s-local-cluster-test/provision-cluster index 928f333a..d4593007 100755 --- a/test/k8s-local-cluster-test/provision-cluster +++ b/test/k8s-local-cluster-test/provision-cluster @@ -9,16 +9,18 @@ OVERRIDE_PATH=0 KIND_CONFIG_FILE=$SCRIPTPATH/kind-three-node-cluster.yaml use_psp=false # shellcheck disable=SC2034 +K8_1_32="kindest/node:v1.32.2@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f" +# shellcheck disable=SC2034 K8_1_31="kindest/node:v1.31.2@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e" # shellcheck disable=SC2034 K8_1_30="kindest/node:v1.30@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e" # shellcheck disable=SC2034 K8_1_29="kindest/node:v1.29.2@sha256:51a1434a5397193442f0be2a297b488b6c919ce8a3931be0ce822606ea5ca245" -K8_VERSION="$K8_1_31" +K8_VERSION="$K8_1_32" KUBECTL_VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) -KIND_VERSION="0.25.0" -HELM_VERSION="3.16.2" +KIND_VERSION="0.27.0" +HELM_VERSION="3.17.1" echoerr() { echo "$@" 1>&2; } @@ -27,7 +29,7 @@ USAGE=$(cat << 'EOM' Executes the spot termination integration test for the Node Termination Handler. Outputs the cluster context directory to stdout on successful completion - Example: provision-cluster -b my-test -i 123 -v 1.31 + Example: provision-cluster -b my-test -i 123 -v 1.32 Optional: -b Base Name of cluster diff --git a/test/k8s-local-cluster-test/run-test b/test/k8s-local-cluster-test/run-test index 86c86bf7..aaa45072 100755 --- a/test/k8s-local-cluster-test/run-test +++ b/test/k8s-local-cluster-test/run-test @@ -16,7 +16,7 @@ NODE_TERMINATION_HANDLER_DOCKER_IMG="" DEFAULT_WEBHOOK_DOCKER_IMG="webhook-test-proxy:customtest" WEBHOOK_DOCKER_IMG="" OVERRIDE_PATH=0 -K8S_VERSION="1.31" +K8S_VERSION="1.32" AEMM_URL="amazon-ec2-metadata-mock-service.default.svc.cluster.local" AEMM_VERSION="1.12.0" AEMM_DL_URL="https://github.com/aws/amazon-ec2-metadata-mock/releases/download/v$AEMM_VERSION/amazon-ec2-metadata-mock-$AEMM_VERSION.tgz" @@ -139,7 +139,7 @@ USAGE=$(cat << 'EOM' -n Node Termination Handler Docker Image -d use GOPROXY=direct to bypass proxy.golang.org -o Override path w/ your own kubectl and kind binaries - -v Kubernetes Version (Default: 1.31) [1.29, 1.30, and 1.31] + -v Kubernetes Version (Default: 1.32) [1.29, 1.30, 1.31 and 1.32] -w Webhook Docker Image EOM From 37485fec413130066763f295b29ac28f0e7c188c Mon Sep 17 00:00:00 2001 From: Tiationg Kho Date: Mon, 24 Feb 2025 17:51:20 -0800 Subject: [PATCH 2/2] Fix ver in makefile and readme --- Makefile | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 72d6183f..382689b3 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ WINDOWS_2022 ?= "windows-10.0.20348.2582/amd64" BINARY_NAME ?= "node-termination-handler" THIRD_PARTY_LICENSES = "${MAKEFILE_PATH}/THIRD_PARTY_LICENSES.md" GOLICENSES = $(BIN_DIR)/go-licenses -K8S_1_25_ASSET_SUFFIX = "_k8s-1-25-or-newer" +K8S_1_29_ASSET_SUFFIX = "_k8s-1-29-or-newer" AMAZON_ECR_CREDENTIAL_HELPER_VERSION = 0.7.1 $(shell mkdir -p ${BUILD_DIR_PATH} && touch ${BUILD_DIR_PATH}/_go.mod) @@ -153,14 +153,14 @@ build-binaries-windows-2022: upload-resources-to-github: ${MAKEFILE_PATH}/scripts/upload-resources-to-github - ${MAKEFILE_PATH}/scripts/upload-resources-to-github -k -s ${K8S_1_25_ASSET_SUFFIX} + ${MAKEFILE_PATH}/scripts/upload-resources-to-github -k -s ${K8S_1_29_ASSET_SUFFIX} upload-resources-to-github-windows: powershell -File ${MAKEFILE_PATH}/scripts/upload-resources-to-github-windows.ps1 -BinariesOnly generate-k8s-yaml: ${MAKEFILE_PATH}/scripts/generate-k8s-yaml - ${MAKEFILE_PATH}/scripts/generate-k8s-yaml -k "1.32.2" -s ${K8S_1_25_ASSET_SUFFIX} + ${MAKEFILE_PATH}/scripts/generate-k8s-yaml -k "1.32.2" -s ${K8S_1_29_ASSET_SUFFIX} sync-readme-to-ecr-public: @ECR_REGISTRY=${ECR_REGISTRY} ${MAKEFILE_PATH}/scripts/ecr-public-login diff --git a/README.md b/README.md index a5b21fcc..2b8885cc 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ helm upgrade --install aws-node-termination-handler \ | NTH Release | K8s v1.32 | K8s v1.31 | K8s v1.30 | K8s v1.29 | K8s v1.28 | K8s v1.27 | K8s v1.26 | K8s v1.25 | | :-----------------------------------------------------------------------------------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | -| [v1.24.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.24.0) | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | +| [v1.24.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.24.0) | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | | [v1.23.1](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.23.1) | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | | [v1.23.0](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.23.0) | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [v1.22.1](https://github.com/aws/aws-node-termination-handler/releases/tag/v1.22.1) | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |