xetys / hetzner-kube

A CLI tool for provisioning kubernetes clusters on Hetzner Cloud
Apache License 2.0
746 stars 116 forks source link

add-worker not joining node to cluster #304

Closed kozy closed 4 years ago

kozy commented 4 years ago

Hi and thanks for the useful tool!

This is related or duplicate of #257.

It seems that cluster add-worker returns successful after a while but the node never joined the cluster.

Trying the join command manually on the node:

kubeadm join 10.0.1.1:6443 --token xxx.xxxxxxx --discovery-token-ca-cert-hash sha256:d3359f<snip>

results in error:

Failed to connect to API Server "10.0.1.1:6443": cluster CA found in cluster-info configmap is invalid: none of the public keys "sha256:f2753<snip>" are pinned

So it seems the discovery token ca cert hash is wrongly generated by the master node after running kubeadm token create --print-join.

Substituting with the ca cert hash from the error i get:

I1213 16:07:17.476782 22375 round_trippers.go:443] GET https://10.0.1.1:6443/api/v1/namespaces/kube-public/configmaps/cluster-info in 62 milliseconds I1213 16:07:17.476809 22375 round_trippers.go:449] Response Headers: I1213 16:07:17.476868 22375 token.go:146] [discovery] Failed to request cluster info, will try again: [Get https://10.0.1.1:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")]

Any ideas? Thanks!

kozy commented 4 years ago

this project is really nice in its simplicity to use but maybe a bit defunct