From fa4db654d7a58af9e5b8b8be904a8024e4aa03c8 Mon Sep 17 00:00:00 2001 From: "Peter W. Morreale" Date: Wed, 21 Sep 2022 10:49:34 -0600 Subject: [PATCH] Fix create_stack for version 1.25 kubernetes 1.25 changed the key for the NoSchedule taint to 'control-plane'. Fix the script to handle both pre and post version 1.25 Signed-off-by: Peter W. Morreale --- clr-k8s-examples/create_stack.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/clr-k8s-examples/create_stack.sh b/clr-k8s-examples/create_stack.sh index e0a999a..943725b 100755 --- a/clr-k8s-examples/create_stack.sh +++ b/clr-k8s-examples/create_stack.sh @@ -115,9 +115,14 @@ function cluster_init() { fi fi - #Ensure single node k8s works + #Ensure single node k8s works both pre and post v1.25 if [ "$(kubectl get nodes | wc -l)" -eq 2 ]; then - kubectl taint nodes --all node-role.kubernetes.io/master- + minor=$(kubeadm version -o short | cut -f 2 -d "." ) + if [ $minor -ge "25" ]; then + kubectl taint nodes --all node-role.kubernetes.io/control-plane- + else + kubectl taint nodes --all node-role.kubernetes.io/master- + fi mode="standalone" fi }