Add Workers to Kubernetes Clusters
Quote from moshe on 15/10/2020, 11:15 pmWhen installing a Kubernetes cluster a token is first initialized to add new workers nodes to the cluster. ** Tokens only available for 24-hours, after that you will not be able to add new worker nodes with the same token. This Guide allows you to add more workers to an existing cluster after 24 hours of token expiration
Managing your Cluster’s Tokens
Using the kubeadm command, list your current tokens. (after 24 hours since the cluster was initialized, the list will likely be empty )kubeadm token listCreate a new token using kubeadm.* By using the –print-join-command argument kubeadm will output the token and SHA hash required to securely communicate with the master.kubeadm token create –print-join-commandUse kubeadm to list all tokens in order to verify the newly created token.kubeadm tokens listJoining the New Worker to the Cluster
With our new token generated for the next 24 Hours add the new worker to the cluster with the following commandsFirst Login with SSH to the new worker node you configuredssh username@192.168.1.130Use the kubeadm join command with the new token to join the node to our cluster.kubeadm join 192.168.1.130:6443 –token qt57zu.wuvqh64un13trr7x –discovery-token-ca-cert-hash sha256:5ad014cad868fdfe9388d5b33796cf40fc1e8c2b3dccaebff0b066a0532e8723List & Verify cluster’s nodes .kubectl get nodesVerify that the worker’s status to ensure no errors encountered.kubectl get nodes my-new-node
When installing a Kubernetes cluster a token is first initialized to add new workers nodes to the cluster. ** Tokens only available for 24-hours, after that you will not be able to add new worker nodes with the same token. This Guide allows you to add more workers to an existing cluster after 24 hours of token expiration
Managing your Cluster’s Tokens
Using the kubeadm command, list your current tokens. (after 24 hours since the cluster was initialized, the list will likely be empty )
kubeadm token list
kubeadm token create –print-join-command
kubeadm tokens list
With our new token generated for the next 24 Hours add the new worker to the cluster with the following commandsFirst Login with SSH to the new worker node you configured
kubeadm join 192.168.1.130:6443 –token qt57zu.wuvqh64un13trr7x –discovery-token-ca-cert-hash sha256:5ad014cad868fdfe9388d5b33796cf40fc1e8c2b3dccaebff0b066a0532e8723
kubectl get nodes
kubectl get nodes my-new-node