failed to run Kubelet: cannot create certificate signing request: Unauthorized

5/14/2018

I have a K8s cluster running under an OpenStack cloud provider.

The cluster is set up using kubeadm tool which contains a master node and slave node .

I'm trying to add an other worker node by using the kubeadm join command, the command shows a positive response telling that the node is successfully added, But I can't find it using kubectl get nodes command.

I investigated and I've found that kubelet on the new slave node is not running showing cannot create certificate signing request: Unauthorized.

-- The start-up result is done.
May 14 12:15:33 vm1 kubelet[17678]: W0514 12:15:33.715964   17678 cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d
May 14 12:15:33 vm1 kubelet[17678]: W0514 12:15:33.738398   17678 hostport_manager.go:68] The binary conntrack is not installed, this can cause failures in network connection cleanup.
May 14 12:15:33 vm1 kubelet[17678]: I0514 12:15:33.738669   17678 server.go:376] Version: v1.10.1
May 14 12:15:33 vm1 kubelet[17678]: I0514 12:15:33.738913   17678 feature_gate.go:226] feature gates: &{{} map[]}
May 14 12:15:33 vm1 kubelet[17678]: I0514 12:15:33.739222   17678 plugins.go:89] No cloud provider specified.
May 14 12:15:33 vm1 kubelet[17678]: F0514 12:15:33.784257   17678 server.go:233] failed to run Kubelet: cannot create certificate signing request: Unauthorized
May 14 12:15:33 vm1 systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
May 14 12:15:33 vm1 systemd[1]: kubelet.service: Unit entered failed state.
May 14 12:15:33 vm1 systemd[1]: kubelet.service: Failed with result 'exit-code'.

version on worker node : kubeadm version kubeadm version: &version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-12T14:14:26Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

version on master node :

kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"10", 
GitVersion:"v1.10.1", 
GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", 
GitTreeState:"clean", BuildDate:"2018-04-12T14:14:26Z", 
GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

command used to make the join :

  • get the token : kubeadm token list | awk '/The default bootstrap token/ { print $1; }'

  • get the hash : openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'

  • join command: kubeadm join --skip-preflight-checks --token {{token}} --discovery-token-ca-cert-hash sha256:{{hash}} master_ip:6443

thanks !

-- Imed Aouidene
docker
kubernetes
ssl-certificate
unauthorized

2 Answers

5/15/2018

It looks like your token has expired, but you can always generate a new one.

Run the following command on master:

kubeadm token generate

Then run the next command on a new worker:

kubeadm join --token=<token> <master-ip>

Example:

kubeadm join --token=858698.51d1418b0490485a 192.168.0.13
-- VAS
Source: StackOverflow

5/15/2018

I had this problem too and the solution was to to re-create the token, as it expires after 24 hours. So:

On master:
kubeadm token create
<outputs NEWTOKEN>

On worker:
kubeadm reset
kubeadm join --token NEWTOKEN --discovery-token-unsafe-skip-ca-verification MASTER:6443

-- dan am
Source: StackOverflow