๋ง์คํฐ ๋ ธ๋์ kubeconfig ํ์ผ์ ํ์ฌ node2๋ก ๋ณต์ฌํด์ ์ค์
kubectl ๋ช
๋ น์ด๊ฐ ์ ์ ์๋ํ๋๋ก ํ๊ธฐ ์ํด,
๋ง์คํฐ ๋
ธ๋์ kubeconfig ํ์ผ์ ํ์ฌ node2๋ก ๋ณต์ฌํด์ ์ค์ ํ๋ ค๋ ๊ฑฐ์์.
root@node2:~/crystal_blog# k get ns
E0418 10:04:25.560185 1102768 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0418 10:04:25.560683 1102768 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0418 10:04:25.562682 1102768 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0418 10:04:25.562990 1102768 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0418 10:04:25.564521 1102768 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?
ํ์ฌ ์์น: root@node2:~/crystal_blog
์ด ๋
ธ๋๋ ์ฟ ๋ฒ๋คํฐ์ค ๋ง์คํฐ๊ฐ ์๋ (์ฆ, API ์๋ฒ๊ฐ ์์)
๐ ๊ทธ๋์ kubectl์ localhost:8080์ผ๋ก ์ฐ๊ฒฐํ๋ ค๋ค ์คํจ
๋ง์คํฐ ๋ ธ๋ (master1 ๋ฑ)์ SSH ์ ์ํด์ ๋ค์ ๋ช ๋ น์ด ์คํ:
ls -l /etc/kubernetes/admin.conf
์ ์์ ์ผ๋ก ์กด์ฌํ๋ฉด, ์ด ํ์ผ์ด kubeconfig ํ์ผ์ด์์.
์์: node2์ IP๊ฐ 192.168.0.102์ด๊ณ , root๋ก ์ ๊ทผ ๊ฐ๋ฅํ๋ค๊ณ ํ ๊ฒ์.
๋ง์คํฐ ๋ ธ๋์์ ๋ค์ ๋ช ๋ น์ด ์ ๋ ฅ:
scp /etc/kubernetes/admin.conf root@192.168.0.102:/root/admin.conf
์ด์ ๋ค์ node2๋ก ๋์๊ฐ์:
export KUBECONFIG=/root/admin.conf
๊ทธ๋ฆฌ๊ณ ํ ์คํธ:
kubectl get nodes
echo 'export KUBECONFIG=/root/admin.conf' >> ~/.bashrc
source ~/.bashrc
์ด์ node2์์๋ kubectl ๋ช
๋ น์ด๋ฅผ ์ธ ์ ์์ด์.
์ฌ์ด๋๋ฐ์์๋ kubectl CLI ์ถ๋ ฅ ๊ฒฐ๊ณผ ๊ธฐ๋ฐ์ผ๋ก ์์
๊ฐ๋ฅํ๊ฒ ๋ฉ๋๋ค.
NFS + DNS ๊ตฌ์ฑ์ผ๋ก Kubernetes ์ธํ๋ผ ์์ ํํ๊ธฐ (0) | 2025.04.18 |
---|---|
[ํ ์ด ํ๋ก์ ํธ] ์ค์ ๊ธฐ์ ์์๋ ์ฌ์ฉํ ์ ์๋ ์ธํ๋ผ ์ํคํ ์ฒ ํ์ต (1) | 2025.04.17 |
ArgoCD ์ค์น ๋ฐ ์ด๊ธฐ ์ค์ (0) | 2025.04.16 |
๋์ ํ๋ก๋น์ (Dynamic Provisioning) (0) | 2025.04.16 |
Kubernetes NFS ๊ธฐ๋ฐ ์ ์ ํ๋ก๋น์ ๋ ๋ฐ ResourceQuota ์ ์ฉ ์ค์ต ์ ๋ฆฌ (0) | 2025.04.16 |