luxas / kubeadm-workshop

Showcasing a bare-metal multi-platform kubeadm setup with persistent storage and monitoring
MIT License
680 stars 190 forks source link

Error when nodes try to join master #16

Open julianstephen opened 7 years ago

julianstephen commented 7 years ago

Was trying out the workshop and ran into some trouble when minion nodes try to join the master. Running on 16.04 (xenial).

ubuntu@k8-1:~/kubeadm-workshop$ kubeadm version
kubeadm version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:33:17Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
ubuntu@k8-1:~/kubeadm-workshop$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:44:27Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.0-alpha.0", GitCommit:"b9e8d2aee6d59330306cb458c1241f5e2578c40b", GitTreeState:"clean", BuildDate:"2017-06-02T03:03:31Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

kubeadm join --token token ip:port is getting stuck at

[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[preflight] Running pre-flight checks
[discovery] Trying to connect to API Server "192.168.0.11:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://192.168.0.11:6443"
[discovery] Cluster info signature and contents are valid, will use API Server "https://192.168.0.11:6443"
[discovery] Successfully established connection with API Server "192.168.0.11:6443"
[bootstrap] Detected server version: v1.8.0-alpha.0
[bootstrap] The server supports the Certificates API (certificates.k8s.io/v1beta1)
[csr] Created API client to obtain unique certificate for this node, generating keys and certificate signing request

I was wondering if it was because of version mismatch as per https://github.com/kubernetes/kubeadm/issues/217 . Since it looked like kubeadm installed the v1.8.0-alpha version for the server, I tried changing the kubernetes-version in kubeadm.yaml to v1.6.4, but this is resulting in my kubeadm init getting stuck at

[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/scheduler.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[apiclient] Created API client, waiting for the control plane to become ready

Retried init after a kubeadm reset, but no luck so far.

luxas commented 7 years ago

Oh, I see. It broke due to the new v1.8 branching thing. Well, can you please manually set the kubernetesVersion to v1.7.0-alpha.2? IIRC that was the one I used.

This is a bit temporary and hack-ish atm since we're waiting for the stable v1.7 release that will ship with the required parts for this workshop to work.

I'll update this workshop as soon as there is a stable v1.7 beta we can rely on, thank you :)

julianstephen commented 7 years ago

Awesome! Nodes are joining now. Did not think to try the 1.7.0-alpha (should've guessed that is the version you used because of the custom metrics) . Thanks a lot for the quick reply, and some more for the great writeup.

Should I close this or leave it open for someone else running into the same issue? I just saw that the 1.8-alpha branch was made 6 days ago, so probably this wasn't broken for anyone who tried before 6 days :-).