• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    해결됨

vagrant up에서 unable to fetch the kubeadm-config ConfigMap이라는 에러가 나타납니다.

23.12.29 15:17 작성 조회수 203

0

VirtualBox 6.1.18

Vagrant 2.4.0 으로 실행하였습니다.

virtual Box는 처음 설치한거라 기존 환경과는 충돌이 없을거라 생각합니다.

치 중에 아래와 같이 에러가 나타났습니다

w2-k8s-1.25.0: Running provisioner: shell...

w2-k8s-1.25.0: Running: C:/Users/zzqq5/AppData/Local/Temp/vagrant-shell20231229-12208-b6gz2f.sh

w2-k8s-1.25.0: [preflight] Running pre-flight checks

w2-k8s-1.25.0: [preflight] Reading configuration from the cluster...

w2-k8s-1.25.0: [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'

w2-k8s-1.25.0: error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Get "https://192.168.1.10:6443/api/v1/namespaces/kube-system/configmaps/kubeadm-config?timeout=10s": net/http: request canceled (Client.Timeout exceeded while awaiting headers)

w2-k8s-1.25.0: To see the stack trace of this error execute with --v=5 or higher

The SSH command responded with a non-zero exit status. Vagrant

assumes that this means the command failed. The output for this command

should be in the log above. Please read the output to determine what

went wrong.

 

worker1은 잘되었는데 그 뒤부터 안된다는 게 잘 이해되지 않습니다...

worker2를 설정하다가 멈춘것으로 보입니다. 따라서 worker3도 생성되지 않았구요.

Master node에서 kubectl get nodes 명령어를 입력하면 w1밖에 나타나지 않습니다.

 

확인해보니 w2에 k8s_pkg_cfg.sh는 잘 실행되었는데 work_nodes.sh에 정의된 kubeadm join에서 timeout이 발생한 것으로 보입니다.

Master모드에서 작업을 시도하는데 멈춰있네요...

 


질문을 구체적으로 하려고 이것저것 찾다보니 해결되어 자문자답하게 되었습니다

 

결론적으로는 Master 노드를 재부팅하여 해결하였습니다.

Master노드에서 netstat -tuplen | grep 6443으로 kube-apiserver 동작하는 것까지 확인한 뒤에 2번노드에서 명령어를 통해 kubeadm join 성공하였습니다.

이후 Master노드와 w1, w2를 건너뛰도록 Vagrantfile을 수정하여 vagrant up을 수행하여 정상적으로 w3을 확보하였습니다.

답변 1

답변을 작성해보세요.

0

안녕하세요

아마 어떠한 호스트 또는 환경 관련 이유로

마스터 노드(컨트롤 플레인 노드)에 w2,3가 조인이 안되었던 것 같네요.

가상머신 w2,w3만 지우고 그냥 vagrant up을 하셔도 클러스터는 구성 되셨을꺼 같습니다.


다른 분들도 참고가 되실 경험을 공유해 주셔서 감사합니다!