Minikube仪表板和任何其他吊舱都不会安排

min*_*alf 3 kubernetes minikube

在遵循hello-minikube指南并安装了minikube 0.26.1之后,仪表板容器未启动,并且hello-minikube容器也未启动。

A kubectl describe pod xxx表示无法安排广告连播。

Events:
 Type     Reason            Age                  From              Message
 ----     ------            ----                 ----               -------
 Warning  FailedScheduling  3m (x3368 over 16h)  default-scheduler  0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.
Run Code Online (Sandbox Code Playgroud)

min*_*alf 5

这与从1.6开始的k8s版本中的污点和公差有关。默认情况下,主节点具有NoSchedule污点。

# kubectl describe node minikube
Name:               minikube
Roles:              master
[...]
Taints:             node-role.kubernetes.io/master:NoSchedule
Run Code Online (Sandbox Code Playgroud)

您可以按照此答案中的说明向Pod添加容差-但在我的情况下,我不想编辑任何Pod规格,因为我想像在实时k8s环境中一样以1:1本地测试我的部署。

另一个选项是删除主节点上的污点。请在此处那里查看文档。

kubectl taint nodes --all node-role.kubernetes.io/master-
Run Code Online (Sandbox Code Playgroud)

在仅具有一个节点的本地迷你库设置的特定情况下,并且在不增加容忍的情况下在本地测试部署,这同样适用:

kubectl taint nodes minikube node-role.kubernetes.io/master:NoSchedule-
Run Code Online (Sandbox Code Playgroud)

这应该是minikube入门指南imho的一部分。