๐ŸŒฑ Infra/Container_ Kubernetes

[์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ๋ฌด์ž‘์ • ๋”ฐ๋ผํ•˜๊ธฐ] Step 3 . ์›Œ์ปค๋…ธ๋“œ ์„ค์น˜/๊ตฌ์„ฑํ•˜๊ธฐ

mini_world 2020. 12. 10. 17:14
๋ชฉ์ฐจ ์ ‘๊ธฐ

 

์ด๋ฒˆ ๋‹จ๊ฒŒ์—์„œ๋Š” ์›Œ์ปค ๋…ธ๋“œ๋ฅผ ๊ตฌ์„ฑํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
3๊ฐœ์˜ ๋…ธ๋“œ ์ค‘ ๋งค๋‹ˆ์ € ๋…ธ๋“œ๋ฅผ ์ œ์™ธํ•œ ๋‚˜๋จธ์ง€ ๋‘ ๋Œ€ (์›Œ์ปค๋…ธ๋“œ)์—์„œ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค. 

 

๊ณ ๊ณ !!

 


 

1. kubeadm join ๋ช…๋ น์–ด ํ™•์ธ (์„ ํƒ์‚ฌํ•ญ)

์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ํด๋Ÿฌ์Šคํ„ฐ์˜ Worker ๋…ธ๋“œ๊ฐ€ ๋˜๊ธฐ ์œ„ํ•ด์„œ Kubeadm join ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
์•ž ํฌ์ŠคํŒ…์—์„œ ์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ์„ ๊ตฌ์„ฑํ•˜๊ธฐ ์œ„ํ•œ ๋ช…๋ น์–ด kubeadm init ์ถœ๋ ฅ ๊ฒฐ๊ณผ์— joinํ•  ์ˆ˜ ์žˆ๋Š” ๋ช…๋ น์–ด๊ฐ€ ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค. :)

๋งŒ์•ฝ ์ด ๋ช…๋ น์–ด๋ฅผ ์žƒ์–ด ๋ฒ„๋ ธ๋‹ค๋ฉด ๋‹ค์‹œ ํ™•์ธํ•ด์•ผ๊ฒ ์ฃ !! ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ join ์ปค๋ฉ˜๋“œ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

[root@kube-manager /]# kubeadm token create --print-join-command

์ถœ๋ ฅ๋˜๋Š” kubeadm join ~~ ์ปค๋ฉ˜๋“œ๋ฅผ ๋ณต์‚ฌ ํ•˜๊ณ  ์•„๋ž˜ ๋‹จ๊ณ„๋ฅผ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

 

2. Worker Node ์—์„œ ๋ช…๋ น์–ด ์‹คํ–‰

๋‘ ์›Œ์ปค๋…ธ๋“œ์—์„œ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

[root@kube-worker01 /]# kubeadm join 10.0.1.10:6443 --token hia3wj.m7hwbitlfg5ygkth \
     --discovery-token-ca-cert-hash sha256:95c3385d64f8c91584a492a736361c40a4b8f81fa6525da986053cd2aea78049 

[root@kube-worker02 /]# kubeadm join 10.0.1.10:6443 --token hia3wj.m7hwbitlfg5ygkth \
     --discovery-token-ca-cert-hash sha256:95c3385d64f8c91584a492a736361c40a4b8f81fa6525da986053cd2aea78049 

์ด ๋‘๊ฐœ์˜ ์›Œ์ปค๋…ธ๋“œ๊ฐ€ ํด๋Ÿฌ์Šคํ„ฐ์— ์ž˜ join ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด๋ด…์‹œ๋‹ค.

[root@kube-manager /]# kubectl get no

 

์—ฌ๊ธฐ๊นŒ์ง€ ํ•ด์„œ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค๋ฅผ ๊ฐ ๋…ธ๋“œ์— ์„ค์น˜ํ•˜๊ณ , ์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ & ์›Œ์ปค ๋…ธ๋“œ๋ฅผ ์„ค์น˜ํ•˜๋Š”๊ฒƒ์ด ๋งˆ๋ฌด๋ฆฌ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค :)

๋‹ค์Œ ๋‹จ๊ณ„๋กœ ๋„˜์–ด๊ฐ€์„œ ์‹ค์Šต์„ ์ง„ํ–‰ํ•ฉ์‹œ๋‹ค!

728x90