花了半天时间挖掘网络后,我仍然无法找到我的工作节点没有获得正确标签的原因。我在 AWS 的 Auto Scaling 组中有我的工作节点,并且我正在使用带有 Kubeadm 的 AWS 云提供商来预置我的集群。在我的所有主节点和工作节点出现后,我没有看到分配给工作节点的适当标签,例如分配给主节点中的工作节点,如下所示:
# kubectl get nodes --show-labels
NAME STATUS ROLES AGE VERSION LABELS
ip-10-100-128-9.ec2.internal Ready <none> 5h12m v1.14.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=ip-10-100-128-9.ec2.internal,kubernetes.io/os=linux
ip-10-100-148-5.ec2.internal Ready <none> 5h12m v1.14.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=ip-10-100-148-5.ec2.internal,kubernetes.io/os=linux
ip-10-100-164-199.ec2.internal Ready <none> 5h12m v1.14.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=ip-10-100-164-199.ec2.internal,kubernetes.io/os=linux
ip-10-100-3-145.ec2.internal Ready master 5h15m v1.14.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=m5.large,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=us-east-1,failure-domain.beta.kubernetes.io/zone=us-east-1c,kubernetes.io/arch=amd64,kubernetes.io/hostname=ip-10-100-3-145.ec2.internal,kubernetes.io/os=linux,node-role.kubernetes.io/master=
ip-10-100-3-55.ec2.internal Ready master 5h15m v1.14.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=m5.large,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=us-east-1,failure-domain.beta.kubernetes.io/zone=us-east-1a,kubernetes.io/arch=amd64,kubernetes.io/hostname=ip-10-100-3-55.ec2.internal,kubernetes.io/os=linux,node-role.kubernetes.io/master=
ip-10-100-3-76.ec2.internal Ready master 5h15m v1.14.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=m5.large,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=us-east-1,failure-domain.beta.kubernetes.io/zone=us-east-1b,kubernetes.io/arch=amd64,kubernetes.io/hostname=ip-10-100-3-76.ec2.internal,kubernetes.io/os=linux,node-role.kubernetes.io/master=
我不知何故怀疑这是我无法为我的 PV 创建 PVC 的原因,我想将它附加到我的 docker 注册表 pod。
# kubectl describe pod docker-registry-5b66dd644d-66f7k -n default | grep -A4 -i Events
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 84s (x11 over 14m) default-scheduler 0/6 nodes are available: 3 node(s) had taints that the pod didn't tolerate, 3 node(s) had volume node affinity conflict.
Warning FailedScheduling 79s (x3 over 82s) default-scheduler 0/4 nodes are available: 4 node(s) had taints that the pod didn't tolerate.
我看到我的存储类和 PV 已创建,并且可以在 AWS 上验证相同的卷 ID。我还尝试使用 AWS CLI 手动尝试将卷附加到我的工作节点,但我成功了,但没有通过 PVC。请告知这里出了什么问题。提前致谢。