본문 바로가기

오류해결

kubectl Error : calico-kube-controllers status Pending , Allow pod scheduling on control-plane 에러 해결하기

반응형

 

원래, 보안상의 이유로, control-plane 노드에서는 Pod를 스케쥴링 할 수 없다.
그럼에도 불구하고 conrol-plane node에 pod를 생성하고 싶다면, 추가 명령어를 실행해야 한다.

에러 메시지

conrol-plane node에 pod 생성 시, 다음과 같은 에러 메시지가 나타난다.

kubectl Error : calico-kube-controllers status Pending , Allow pod scheduling on control-plane

현 상태 확인 명령어, Status :

확인 명령어

kubectl get pods -n kube-system

현 상태, Status Output :

NAME                                       READY   STATUS    RESTARTS   AGE
calico-kube-controllers-56cdb7c587-vrqw7   0/1     Pending   0          2d20h
calico-node-zzxmr                          1/1     Running   0          2d22h
coredns-6d4b75cb6d-t7tvn                   1/1     Running   0          2d22h
coredns-6d4b75cb6d-xdds6                   1/1     Running   0          2d22h
etcd-master                                1/1     Running   0          2d22h
kube-apiserver-master                      1/1     Running   0          2d22h
kube-controller-manager-master             1/1     Running   0          2d22h
kube-proxy-z6mwf                           1/1     Running   0          2d22h
kube-scheduler-master                      1/1     Running   0          2d22h

왜 이런 일이 발생하는가

앞서 얘기 한 것 처럼, 원래 보안상의 이유로 control-plane 노드에서는 Pod를 스케쥴링 할 수 없다.
테스트 하는 거니까, control-plane 노드에 Pod를 스케쥴링 할 수 있게 풀어보자.

일단, 어떤 메시지를 출력하는지 보자.

[root@master ~]# kubectl get events --namespace=kube-system

LAST SEEN   TYPE      REASON             OBJECT                                         MESSAGE
4m35s       Warning   FailedScheduling   pod/calico-kube-controllers-56cdb7c587-vrqw7   0/1 nodes are available: 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling.

해결 방법, Solve :

다음 명령을 실행 해 보면, 노트가 untainted 되었다고 나온다.

[root@master ~]# kubectl taint nodes --all node-role.kubernetes.io/control-plane-

결과, Output messages :

node/master untainted

해결 되었는지 확인  :

확인 명령어 :

[root@master ~]# kubectl get pods -n kube-system

다음과 같이 모두 Running 상태가 되면, 해결 된 것이다.
Output message :

[root@master ~]# kubectl get pods -n kube-system

NAME                                       READY   STATUS    RESTARTS   AGE
calico-kube-controllers-56cdb7c587-vrqw7   1/1     Running   0          2d20h
calico-node-zzxmr                          1/1     Running   0          2d22h
coredns-6d4b75cb6d-t7tvn                   1/1     Running   0          2d22h
coredns-6d4b75cb6d-xdds6                   1/1     Running   0          2d22h
etcd-master                                1/1     Running   0          2d22h
kube-apiserver-master                      1/1     Running   0          2d22h
kube-controller-manager-master             1/1     Running   0          2d22h
kube-proxy-z6mwf                           1/1     Running   0          2d22h
kube-scheduler-master                      1/1     Running   0          2d22h

EOF

반응형