After the control plan at KKP has been created, you get a similar output like this:
#Install kubeadm on you local system & the worker node: https://kubernetes.io/docs/setup/independent/install-kubeadm/
# ====================================
# ======= On your local system =======
# ====================================
#
# => Create a new token for the new node
kubeadm token --kubeconfig kubeconfig create --print-join-command
# ====================================
# ======== On the worker node ========
# ====================================
#
#Use the command which got previously generated by kubeadm
#example:
#kubeadm join --token AAAAAA.BBBBBBBBBBBBB https://w8s2kvp6fn.stable-europe-west1-b.run.lab.kubermatic.io:31048 --discovery-token-ca-cert-hash sha256:aaaabbbbcccc
Instead of installing kubeadm manual, like described at install-kubeadm, you could use the attached Dockerfile
NOTE: update K8S_VERSION
to deployed version of the control plan
docker build -t local/kubeadm --build-arg K8S_VERSION=1.17.9 . \
&& docker run -it -v ~/Downloads/kubeconfig-admin-CLUSTER_ID:/kubeconfig local/kubeadm \
kubeadm token --kubeconfig kubeconfig create --print-join-command
Now copy the setup script to the target node, install kubeadm and join the cluster:
scp kubeadm-install.sh ubuntu@TARGET_HOST_IP:/home/ubuntu/
ssh ubuntu@TARGET_HOST_IP
### install kubeadm
sudo /home/ubuntu/kubeadm-install.sh 1.17.9
### copy join command with generated token which got previously generated by kubeadm
# example:
sudo kubeadm join --token AAAAAA.BBBBBBBBBBBBB https://w8s2kvp6fn.stable-europe-west1-b.run.lab.kubermatic.io:31048 --discovery-token-ca-cert-hash sha256:aaaabbbbcccc
Note: On some 1.18.x
versions you may get following error:
error execution phase kubelet-start: cannot get Node "baremetal-sim-worker-1": nodes "baremetal-sim-worker-1" is forbidden: User "system:bootstrap:9wevxn" cannot get resource "nodes" in API group "" at the cluster scope
To see the stack trace of this error execute with --v=5 or higher
If it this happens, please try to execute this command instead of , see [Kubernetes issue #89882 - User cannot get resouce "nodes" in API group ""](https://github.com/kubernetes/kubernetes/issues/89882#issuecomment-610071969):
```bash
kubeadm init phase bootstrap-token --kubeconfig kubeconfig