본문 바로가기

CLOUD/CUBE

쿠버네티스 설치(Kubernetes install)하면서 발생한 에러 및 해결방법

반응형

쿠버네티스 설치하면서 발생한 에러들 입니다.

 

error 1

 

The connection to the server localhost:8080 was refused - did you specify the right host or port?

 

설치 후 다음날 켜보니 위 구문처럼 에러가 뜨더군요. 찾아보니 쿠버네티스 설정이 저장되어 있지 않아 발생한 에러였습니다.

 

계정 홈 디렉토리에 설정 파일을 복사하면 재부팅 된 이후에도 값이 남아 있어 정상 연결이 됩니다.


[root@master ~]# mkdir -p $HOME/.kube
[root@master ~]# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[root@master ~]# chown $(id -u):$(id -g) $HOME/.kube/config

 

 

error 2

 

The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.

 

설치하다가 node에서 master로 조인 하려고 했을때 떳던 에러입니다.

 

cgroup(control group) 관리자가 init인데 Centos는 init 시스템이 systemd이다. 결국 kubelet에서 관리자가 2명이란 뜻

 

 

systemd를 cgroup 드라이버로 사용하겠다는 구문을 넣어주면 된다.


vim /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"]
}

 

# systemctl daemon-reload
# systemctl restart docker
# systemctl restart kubelet

 

 

error 3

 

[preflight] Running pre-flight checks
error execution phase preflight: couldn't validate the identity of the API Server: could not find a JWS signature in the cluster-info ConfigMap for token ID "4w05u2"
To see the stack trace of this error execute with --v=5 or higher

 

이것저것 하다가 노드에서 클러스터를 끊고 다시 연결하려니 위 구문처럼 떳다.

 

토큰이 맞지 않는다는 뜻

 

 

아래 명령어로 해결


kubeadm token list
kubeadm token delete 토큰이름
kubeadm token create --print-join-command   

 

 

 

반응형