Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix create_stack for version 1.25 #347

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

pwmorreale
Copy link
Contributor

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]

@comjf
Copy link

comjf commented Nov 12, 2022

Ha I should have checked the PRs before attempting my own fix here. I ran into the same issue, here is my solution that does the same thing:

diff --git a/clr-k8s-examples/create_stack.sh b/clr-k8s-examples/create_stack.sh
index e0a999a..60f12e2 100755
--- a/clr-k8s-examples/create_stack.sh
+++ b/clr-k8s-examples/create_stack.sh
@@ -117,7 +117,13 @@ function cluster_init() {
 
        #Ensure single node k8s works
        if [ "$(kubectl get nodes | wc -l)" -eq 2 ]; then
-               kubectl taint nodes --all node-role.kubernetes.io/master-
+              if [[ -n "${K8S_VER}" && $(echo "${K8S_VER}" | awk -F. '{print $2}') -lt 24 ]]; then
+                  kubectl taint nodes --all node-role.kubernetes.io/master-
+              else
+                  kubectl taint nodes --all node-role.kubernetes.io/control-plane-
+              fi
                mode="standalone"
        fi
 }

I think yours is a little better. However, I think the version change happened in 1.24 no?

I get that impression from reading:

@pwmorreale
Copy link
Contributor Author

pwmorreale commented Nov 13, 2022 via email

Copy link
Contributor

@dklyle dklyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems there was a 1.24 release: https://github.com/clearlinux-pkgs/kubernetes/releases/tag/1.24.4-136. If you update to use 24 instead of 25, I'll approve.

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]>
@pwmorreale
Copy link
Contributor Author

AFAICT, 1.24 includes both taints for new clusters, 1.25 only contains the 'control-plane' taint, and everything prior to 1.24 contains the 'master' taint.

kubernetes/kubernetes#107533

Copy link
Contributor

@dklyle dklyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@dklyle dklyle merged commit 9e36973 into clearlinux:master Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants