If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.
If no, delete this section and continue on.
Choose one: BUG REPORT or FEATURE REQUEST
kubeadm version (use kubeadm version): 1.12
Environment:
kubectl version):1.12uname -a):3.10.0-862.11.6.el7.x86_64Kubeadm join does not accept token. It takes only the first 5 characters and emits everything after "." and fails to join the cluster.
kubeadm join --token "p3wt5t.4fwbefoc5dyhrxyz" --discovery-token-ca-cert-hash sha256:XXXXXX master:6443
Failed to connect to API Server "master:6443": token id "p3wt5t" is invalid for this cluster or it has expired. Use "kubeadm token create" on the master node to creating a new valid token
Node join the cluster
Create a kubernetes cluster with kubeadm and external etcd As described here https://v1-11.docs.kubernetes.io/docs/setup/independent/high-availability/#external-etcd
@sujithbhaskaran according to the code first part of the token is a token id, second part is a secret. When kubeadm tries to connect to API server it uses full token. However, when it fails to connect to API server it reports only token id.
Could it be that your token expired? Can you try to follow kubeadm suggestion and create new token?
/priority awaiting-more-evidence
I tried with the new token but the same issue.
what happens if you use the real IP of the master node?
fyi, I tested (and automated it), and works as expected.
generate token and hash:
https://github.com/ReSearchITEng/kubeadm-playbook/blob/master/roles/master/tasks/main.yml
consume them (join):
https://github.com/ReSearchITEng/kubeadm-playbook/blob/master/roles/node/tasks/main.yml
tested in both k8s 1.12.0 and 1.12.1
I will test this again and update.
On Wed, Oct 10, 2018 at 12:31 AM ReSearchITEng notifications@github.com
wrote:
fyi, I tested (and automated it), and works as expected.
generate token and hash:https://github.com/ReSearchITEng/kubeadm-playbook/blob/master/roles/master/tasks/main.yml
consume them (join):https://github.com/ReSearchITEng/kubeadm-playbook/blob/master/roles/node/tasks/main.yml
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/kubeadm/issues/1161#issuecomment-428467858,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AjnXMDEadR66krm5aWCb_z1Uqh0fdKlLks5ujaJegaJpZM4XL-QV
.
--
Thanks & Regards
Sujith Bhaskaran
650-653-2093
http://smart.salesforce.com/sig/sbhaskaran//us_mb/default/link.html
Closing due to timeout and counter-evidence from numerous users.
I know this ticket is closed but i found the great solution
root@k8master:~# kubeadm token generate --kubeconfig /etc/kubernetes/admin.conf
root@k8master:~# kubeadm token list
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS
k1fw6r.hseqjtg6lxvw50wc 23h 2019-01-24T19:35:51-08:00 authentication,signing <none> system:bootstrappers:kubeadm:default-node-token
root@k8master:~# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
Output Would be something like this
"XXXXXXXXXXXb9ff2aa46bXXXX3419e8b5086XXXXXXXXXXXXXXXXXXXX"