[k8s] 쿠버네티스 클러스트 구성

Posted by Albert 2Day 18Hour 55Min 20Sec ago [2025-04-17]

1. 서버구성

  master node: k8s-master

  worker node: k8s-work1, k8s-work2

  k8s설치는 아래링크 참조 

  https://visionboy.me/865


2. master, worker node 모두 설치후 우선 master node에서 아래 명열어를 실행하여 join 토큰 문자열을 가져온다.

albert@k8s-master:~$ kubeadm token create --print-join-command
kubeadm join 192.168.56.5:6443 --token z7al62.yt09qongepuhun96 --discovery-token-ca-cert-hash sha256:be510ba0fedc3495522a67fb143b4c3393adfa7f0d427cd4387708c5d61d3767


3. k8s-work1, k8s-work2 워커노드상 master node에서 추출한 join 문자열을 그대로 입력하여 클러스터 죠인함

albert@k8s-work1:~/.kube$ sudo -i

root@k8s-work1:~' kubeadm join 192.168.56.5:6443 --token z7al62.yt09qongepuhun96 --discovery-token-ca-cert-hash sha256:be510ba0fedc3495522a67fb143b4c3393adfa7f0d427cd4387708c5d61d3767

[preflight] Running pre-flight checks
[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.


4. join 상태확인

albert@k8s-work1:~/.kube$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready control-plane 44m v1.29.15
k8s-work1 Ready <none> 2m11s v1.29.15
k8s-work2 Ready <none> 119s v1.29.15





LIST

Copyright © 2014 visionboy.me All Right Reserved.