본문 바로가기

Tech/[Trouble Shooting] Logs

0/3 nodes are available: 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }, 2 node(s) didn't match Pod's node affinity/selector. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.

요약

  • 노드 셀렉터로 특정 노드에 Pod 배포를 지정했는데, 해당 노드를 찾을 수 없어 발생한 문제

 

해결

spec: nodeSelector: kubernetes.io/hostname: k8s-worker1 부분이 문제였다.

적절한 호스트이름으로 변경해 주면 된다. (나의 경우, k8s-node1로 변경했다.)

apiVersion: v1
kind: Pod
metadata:
  name: pod-1
  labels:
     app: pod
**spec:
  nodeSelector:
    kubernetes.io/hostname: k8s-worker1**
  containers:
  - name: container
    image: kubetm/app
    ports:
    - containerPort: 8080