什么意思呢?什么意思呢?
这个提示表示,没有节点可以接受调度。
为什么会这样呢?
因为我们现在三个节点都是master节点,还没有添加node节点。默认情况下,master打了污点(taint,后续再介绍),master节点不接收调度。
由于我们这里是测试环境,没有多余的机器来作为node节点,可以手动删除master的污点,让master节点接收调度。
通过如下命令可以查看taint信息:
[root@k8s-master001 ~]# kubectl get no -o yaml | grep taint -A 5
f:taints: {}
manager: kube-controller-manager
operation: Update
time: "2020-09-10T09:10:40Z"
- apiVersion: v1
fieldsType: FieldsV1
--
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
status:
addresses:
- address: 10.26.25.20
--
f:taints: {}
manager: kube-controller-manager
operation: Update
time: "2020-09-10T09:30:25Z"
- apiVersion: v1
fieldsType: FieldsV1
--
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
status:
addresses:
- address: 10.26.25.21
--
f:taints: {}
manager: kube-controller-manager
operation: Update
time: "2020-09-10T09:35:43Z"
- apiVersion: v1
fieldsType: FieldsV1
--
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
status:
addresses:
- address: 10.26.25.22
删除污点`http://node-role.kubernetes.io/master`,如下所示
[root@k8s-master001 ~]# kubectl taint nodes --all node-role.kubernetes.io/master-
node/k8s-master001 untainted
node/k8s-master002 untainted
node/k8s-master003 untainted
然后现在在看nginx的状态,已经变为ContainerCreating,这表示已经分配到节点,开始创建nginx的pod了