環境
- EKS v1.13
- NGINX Ingress Controller 0.26.1
事象
公式通りにデプロイ
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
Pendingになる
$ kubectl get pod -n ingress-nginx
NAME READY STATUS RESTARTS AGE
nginx-ingress-controller-5bcd4b688-9hlzz 0/1 Pending 0 2m50s
describe pod(eventのみ記載)
$ kubectl describe pod -n ingress-nginx
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 17s (x2 over 17s) default-scheduler 0/3 nodes are available: 3 node(s) didn't match node selector.
スケジューラが適切なノードが発見できない、と言っている。
ちなみに、kubectl logs
は、ログが出力されませんでした。つまりコンテナは作成されていない。
ノードに異常は見られない
$ kubectl get node -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
ip-10-0-16-149.us-east-2.compute.internal Ready <none> 146m v1.13.11-eks-5876d6 10.0.16.149 <none> Amazon Linux 2 4.14.146-119.123.amzn2.x86_64 docker://18.6.1
ip-10-0-44-207.us-east-2.compute.internal Ready <none> 146m v1.13.11-eks-5876d6 10.0.44.207 <none> Amazon Linux 2 4.14.146-119.123.amzn2.x86_64 docker://18.6.1
ip-10-0-78-170.us-east-2.compute.internal Ready <none> 146m v1.13.11-eks-5876d6 10.0.78.170 <none> Amazon Linux 2 4.14.146-119.123.amzn2.x86_64 docker://18.6.1
直接的な原因
NginxのPodにNodeSelectorが追加された
背景
KubernetesがWindowsノードにも対応していくが、NGINX Ingress ControllerはLinuxノードで起動する必要があるため、NodeSelectorが追加された。
恐らく、今後はkubeadmやクラウドのマネージドサービスなど、ノードにはデフォルトでLinux/Windowsを示すラベルが貼られるのだと思う。
たぶん公式のWell-Known Labelsにあるようなものだろう。