kubernetes调度——污点Taint和容忍Toleration 一、通过节点属性调度 1、节点名称 2、节点标签 2.1 查看节点标签 2.2 添加标签 2.3 修改标签 2.4 删除标签 2.5 通过节点标签进行调度 二、污点Taint和容忍Toleration 1、污点Taint 1.1 查看Master节点的污点 1.2 添加污点 1.3 删除污点 2、容忍Toleration 一、通过节点属性调度 1、节点名称 [root@k8s-master ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master.linux.com Ready control-plane 127d v1.29.1 k8s-node01.linux.com Ready <none> 127d v1.29.1 k8s-node02.linux.com Ready <none> 127d v1.29.1 apiVersion: apps/v1 kind: Deployment metadata: name: test1 spec: replicas: 2 selector: matchLabels: app: test1 template: metadata: labels: app: test1 spec: nodeName: k8s-node02.linux.com // 指定工作节点名称 containers: - name: test1 image: centos:7 imagePullPolicy: IfNotPresent command: - sleep - "3600" [root@k8s-master schedulerTest]# kubectl create -f test1.yaml deployment.apps/test1 created [root@k8s-master schedulerTest]# [root@k8s-master schedulerTest]# kubectl get pod -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES test1-d69854cd5-jgpvm 1/1 Running 0 7s 10.88.242.139 k8s-node02.linux.com <none>