Docs/CloudNative/Kubernetes/Docs/init/token
2022-10-18 16:59:37 +08:00

30 lines
No EOL
1.4 KiB
Text

Your Kubernetes control-plane has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Alternatively, if you are the root user, you can run:
export KUBECONFIG=/etc/kubernetes/admin.conf
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/
You can now join any number of the control-plane node running the following command on each as root:
kubeadm join 172.17.0.9:6443 --token ojqm3u.enmujo85v51fi4ic \
--discovery-token-ca-cert-hash sha256:017cbb61cfbece0c1205ff2540736879a209649e423d62c208f1b613fec524f1 \
--control-plane --certificate-key 47411469c54cdeb1de9c245a6a8694ad424bd2feaf029a0629c07cd2c08e0240
Please note that the certificate-key gives access to cluster sensitive data, keep it secret!
As a safeguard, uploaded-certs will be deleted in two hours; If necessary, you can use
"kubeadm init phase upload-certs --upload-certs" to reload certs afterward.
Then you can join any number of worker nodes by running the following on each as root:
kubeadm join 172.17.0.9:6443 --token ojqm3u.enmujo85v51fi4ic \
--discovery-token-ca-cert-hash sha256:017cbb61cfbece0c1205ff2540736879a209649e423d62c208f1b613fec524f1