Create new Kubernetes token to join

When adding new nodes to the cluster, a token is needed to join the new node to the cluster.

Login into the management node and create a new token:

kubeadm token create --print-join-command

The result is something like this:

kubeadm join 192.168.76.3:6443 --token vcatsw.x589176bunx86udn --discovery-token-ca-cert-hash sha256:35e8c087d7a951747beg3ea5e99c5b1701ac485a019e5474ae1b87c2db52022a

Remove namespace on “Terminating”

When removing Namespaces are waiting for (already) deleted pods or deployments, there is something wrong…
But if you do not want to wait until the waiting is over, you can terminate the pod/deployment manually:

Run on the admin node:

NS=kubectl get ns |grep Terminating | awk 'NR==1 {print $1}' && kubectl get namespace "$NS" -o json | tr -d "\n" | sed "s/\"finalizers\": [[^]]+]/\"finalizers\": []/" | kubectl replace --raw /api/v1/namespaces/$NS/finalize -f -

Use of course at your own risk!