๋ง์ฝ kubeadm์ ํตํด master์ node join์ ์๋ํ ๊ฒฝ์ฐ ์๋์ ๊ฐ์ด ์ค๋ฅ๊ฐ ๋๋ค๋ฉด
ubuntu@node:~$ sudo kubeadm join 192.168.241.92:6443 --token 4rlhh1.4dehcs172qy9enyj --discovery-token-ca-cert-hash sha256:b5347bb4959f63e6100142700db4b7d69ea0d860c332265a1748cef29698f814
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Unauthorized
To see the stack trace of this error execute with --v=5 or higher
master์ token์ด expire๋์์ ๊ฐ๋ฅ์ฑ์ด ๋๋ค.
ubuntu@master:~$ sudo kubeadm token list
[sudo] password for ubuntu:
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS
4rlhh1.4dehcs172qy9enyj <invalid> 2021-03-08T04:42:08Z authentication,signing The default bootstrap token generated by 'kubeadm init'. system:bootstrappers:kubeadm:default-node-token
TTL์ด invalid ๋์ด์๋ ๊ฒ์ ํ์ธ ๊ฐ๋ฅํ๋ค.
token์ ์๋กญ๊ฒ ๋ฐํํ์.
ubuntu@master:~$ sudo kubeadm token create
qigsyn.hkxhfwyks4sohiem
list๋ฅผ ํ์ธํด ๋ณด๋ฉด 23์๊ฐ๋์ token์ฌ์ฉ ๊ฐ๋ฅํจ์ ํ์ธ ํ ์ ์๋ค.
ubuntu@master:~$ sudo kubeadm token list
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS
4rlhh1.4dehcs172qy9enyj <invalid> 2021-03-08T04:42:08Z authentication,signing The default bootstrap token generated by 'kubeadm init'. system:bootstrappers:kubeadm:default-node-token
qigsyn.hkxhfwyks4sohiem 23h 2021-03-09T12:49:20Z authentication,signing <none> system:bootstrappers:kubeadm:default-node-token
node์์ token์ ๋ณ๊ฒฝํด์ ๋ค์ join์ ํด์ฃผ์. ์๋์ ๊ฐ์ด ๋ก๊ทธ๊ฐ ๋์ค๋ฉด ์ฑ๊ณตํ ๊ฒ์ด๋ค.
ubuntu@node:~$ sudo kubeadm join 192.168.241.92:6443 --token qigsyn.hkxhfwyks4sohiem --discovery-token-ca-cert-hash sha256:b5347bb4959f63e6100142700db4b7d69ea0d860c332265a1748cef29698f814
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.
Run 'kubectl get nodes' on the control-plane to see this node join the cluster.
'...' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Linux] VM์ NFS๋ก ์ฌ์ฉํ๊ธฐ (0) | 2021.12.08 |
---|---|
[K8S] ํ์ผ(.yaml)์์ ๋ฌธ์์ด ๊ฒ์ ํ ํ ๊ทธ ๋ฌธ์์ด์ ๋ผ์ธ ๋๋ฒ ๊ฐ์ ธ์ค๊ธฐ (0) | 2021.11.26 |
[Kubernetes] kubeadm ์ด์ฉํ์ฌ k8s Cluster ๋ฐฐํฌํ๊ธฐ(๊ณต์๋ฌธ์ ์์ฃผ) (0) | 2021.11.19 |
[Network] netstat ๋ช ๋ น์ด๋ฅผ ์ด์ฉํ ๋ผ์ฐํ ํ ์ด๋ธ ํ์ธ (0) | 2021.11.17 |
[Linux] Add Directory to $PATH in Linux (0) | 2021.11.12 |