Skip to content

Commit

Permalink
Fix create_stack for version 1.25
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pwmorreale committed Sep 21, 2022
1 parent af1171a commit fa4db65
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions clr-k8s-examples/create_stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit fa4db65

Please sign in to comment.