节点有一个污点,那就是Pod在部署到Kubernetes集群时不会容忍错误 [英] Node had taints that the pod didn't tolerate error when deploying to Kubernetes cluster
问题描述
我正在尝试将我的微服务部署到Kubernetes集群中.我的集群有一个主节点和一个工作节点.我为Kubernetes部署的研发创建了该集群.当我尝试进行部署时,我收到了如下所示的均匀错误消息,
I am trying to deploy my microservices into Kubernetes cluster. My cluster having one master and one worker node. I created this cluster for my R&D of Kubernetes deployment. When I am trying to deploy I am getting the even error message like the following,
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling <unknown> default-scheduler 0/2 nodes are available: 2 node(s) had taints that the pod didn't tolerate
我的尝试
当我探索该错误时,我在论坛中找到了一些有关在节点等中重启docker的评论.因此,在此之后,我重启了Docker.但是错误仍然相同.
When I am exploring about the error, I found some comments in forums for restarting the docker in the node etc. So after that I restarted Docker. But still the error is the same.
当我尝试使用命令kubectl get nodes
时,它显示出两个节点都是主节点并且都处于ready
状态.
When I tried the command kubectl get nodes
it showing like that both nodes are master and both are ready
state.
NAME STATUS ROLES AGE VERSION
mildevkub020 Ready master 6d19h v1.17.0
mildevkub040 Ready master 6d19h v1.17.0
我在这里没有找到工作节点.我使用一个负载均衡器创建了一个主节点(mildevkub020)和一个工作节点(mildev040).我通过以下链接关注了Kubernetes的官方文档,
I did not found worker node here. I created one master (mildevkub020) and one worker node (mildev040) with one load balancer. And I followed the official documentation of Kubernetes from the following link,
https://kubernetes.io/docs/setup /production-environment/tools/kubeadm/high-availability/
我的问题
此错误是由于群集问题引起的吗?因为我找不到集群工作节点.只有主节点.
Is this error is because of the cluster problem? Because I am not finding the cluster worker node. Only master node.
推荐答案
您可以运行以下命令从主节点上移除异味,然后应该可以将pod部署在该节点上
You can run below command to remove the taint from master node and then you should be able to deploy your pod on that node
kubectl taint nodes mildevkub020 node-role.kubernetes.io/master-
kubectl taint nodes mildevkub040 node-role.kubernetes.io/master-
现在关于为什么将其显示为主节点,请检查您运行的将kubeadm加入节点的命令.主节点和工作节点的加入有单独的命令.
Now regarding why its showing as master node check the command you ran to join the node with kubeadm. There are separate commands for master and worker node joining.
这篇关于节点有一个污点,那就是Pod在部署到Kubernetes集群时不会容忍错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!