I created a Kubernetes cluster a few days ago with 1 Master and 1 worker Node. Now I want to add another node to the cluster, but the token printed by the original "kubeadm init" on the master has expired (by default after 24 hours).
The "kubeadm join" command have a "--discovery-file". It takes a config file and I have tried with the format I found here:
https://github.com/kubernetes/kubeadm/blob/master/docs/design/design_v1.8.md
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: <really long certificate data>
server: https://10.138.0.2:6443
name: ""
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []
I copied the corresponding data from my working kubectl config file and created a local file "a.config".
But, when I try the command "sudo kubeadm join --discovery-file a.conf" it fails with the following error messages:
[discovery: Invalid value: "": token [""] was not of form ["^([a-z0-9]{6})\\.([a-z0-9]{16})$"], discovery: Invalid value: "": token must be of form '[a-z0-9]{6}.[a-z0-9]{16}']
What am I missing here?
What is a procedure know to work in my situation? I prefer not to tear down the cluster and re-join it again.