在Mac with kind上,我创建了一个单节点集群,然后尝试按照https://kind.sigs.k8s.io/docs/user/ingress/中的说明安装nginx入口
kind create cluster --name devops
kubectl apply --filename https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=180s
它超时;而对于节点来说,没有污点
kubectl get node
NAME STATUS ROLES AGE VERSION
devops-control-plane Ready control-plane 16m v1.25.2
kubectl describe node devops-control-plane | grep Taint
Taints: <none>
超时是由于无法将pod放置在主节点上
kubectl -n ingress-nginx describe pod ingress-nginx-controller-7d68cdddd8-tkzzz
...
Node-Selectors: ingress-ready=true
kubernetes.io/os=linux
Tolerations: node-role.kubernetes.io/control-plane:NoSchedule
node-role.kubernetes.io/master:NoSchedule
node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 104s default-scheduler 0/1 nodes are available: 1 node(s) didn't match Pod's node affinity/selector. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling.
我做错了什么?
1条答案
按热度按时间9udxz4iz1#
请阅读有关assigning Pods to nodes的文档!我发现您的pod上有一些节点选择器。这可能是调度失败的原因。您可以删除节点选择器或向节点添加所需的标签(我猜缺少ingress-ready标签):