栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

nodes are available: 1 node(s) had taints that the pod didn‘t tolerate

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

nodes are available: 1 node(s) had taints that the pod didn‘t tolerate

首先、异常的发现

Troubleshooting was easy... kubectl describe node revealed the taint, and figuring out the required configuration change was simple.

$ kubectl get nodes                                                                                                         
NAME      STATUS   ROLES    AGE   VERSION                                                                                            
homelab   Ready    master   23h   v1.17.0

$ kubectl describe node homelab
Name:               homelab
Roles:              master
Labels:             beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/os=linux
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=homelab
                    kubernetes.io/os=linux
                    node-role.kubernetes.io/master=
Annotations:        kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock                                             
                    node.alpha.kubernetes.io/ttl: 0
                    volumes.kubernetes.io/controller-managed-attach-detach: true                                                 
CreationTimestamp:  Sat, 28 Dec 2019 13:28:27 -0800
Taints:             node-role.kubernetes.io/master:NoSchedule
Unschedulable:      false

官方描述

And there it is – by default, kubeadm init configured this node as a Kubernetes master, which would normally take care for managing other Kubernetes "worker" (or "non-master") nodes. The Kubernetes Concepts documentation describes the distinction between the Kubernetes master and non-master nodes as follows:

The Kubernetes Master is a collection of three processes that run on a single node in your cluster, which is designated as the master node. Those processes are: kube-apiserver, kube-controller-manager and kube-scheduler.Each individual non-master node in your cluster runs two processes:kubelet, which communicates with the Kubernetes Master.kube-proxy, a network proxy which reflects Kubernetes networking services on each node.

So anyway, as soon as I saw node-role.kubernetes.io/master:NoSchedule I began nodding my head, realizing what the issue was. One Google search returned me straight back to the very installation guide I followed I had skimmed over, and the instruction I had skipped:

Control plane node isolation
By default, your cluster will not schedule pods on the control-plane node for security reasons. If you want to be able to schedule pods on the control-plane node, e.g. for a single-machine Kubernetes cluster for development, run:

kubectl taint nodes --all node-role.kubernetes.io/master-

With output looking something like:

node "test-01" untainted taint "node-role.kubernetes.io/master:" not found taint "node-role.kubernetes.io/master:" not found

This will remove the node-role.kubernetes.io/master taint from any nodes that have it, including the control-plane node, meaning that the scheduler will then be able to schedule pods everywhere.

So... one quick kubectl taint nodes --all node-role.kubernetes.io/master- command later, and my single-node K8s cluster was now actually useful for running pods!

NOTE: there's a LOT more output from kubectl describe node that this; I'm just trimming the rest for brevity; all we needed was this clue about the configured Taints.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/710085.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号