我已经使用 kops 设置了一个独立的 k8s 集群,所以我希望所有 pod 也只在 1 个 master 上运行。集群启动良好,但 kube-dns 和 kube-autoscaler pod 没有运行,处于挂起状态。这是节点描述
kubectl describe nodes
Name: ip-10-0-3-184.ap-southeast-1.compute.internal
Roles: master
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/instance-type=m3.large
beta.kubernetes.io/os=linux
failure-domain.beta.kubernetes.io/region=ap-southeast-1
failure-domain.beta.kubernetes.io/zone=ap-southeast-1a
kops.k8s.io/instancegroup=master-ap-southeast-1a
kubernetes.io/hostname=ip-10-0-3-184.ap-southeast-1.compute.internal
kubernetes.io/role=master
node-role.kubernetes.io/master=
Annotations: node.alpha.kubernetes.io/ttl=0
volumes.kubernetes.io/controller-managed-attach-detach=true
Taints: node-role.kubernetes.io/master:NoSchedule
但是/var/log/kube-scheduler.log
是:
I0526 12:49:54.629475 1 scheduler.go:191] Failed to schedule pod: kube-system/kube-dns-autoscaler-787d59df8f-8jgn7
I0526 12:49:54.629570 1 factory.go:1251] Updating pod condition for kube-system/kube-dns-autoscaler-787d59df8f-8jgn7 to (PodScheduled==False)
I0526 12:50:09.706382 1 scheduler.go:191] Failed to schedule pod: kube-system/kube-dns-7785f4d7dc-rqzdq
I0526 12:50:09.706484 1 factory.go:1251] Updating pod condition for kube-system/kube-dns-7785f4d7dc-rqzdq to (PodScheduled==False)
I0526 12:50:10.632285 1 scheduler.go:191] Failed to schedule pod: kube-system/kube-dns-autoscaler-787d59df8f-8jgn7
I0526 12:50:10.632371 1 factory.go:1251] Updating pod condition for kube-system/kube-dns-autoscaler-787d59df8f-8jgn7 to (PodScheduled==False)
I0526 12:50:41.709687 1 scheduler.go:191] Failed to schedule pod: kube-system/kube-dns-7785f4d7dc-rqzdq
I0526 12:50:41.709796 1 factory.go:1251] Updating pod condition for kube-system/kube-dns-7785f4d7dc-rqzdq to (PodScheduled==False)
I0526 12:50:42.635260 1 scheduler.go:191] Failed to schedule pod: kube-system/kube-dns-autoscaler-787d59df8f-8jgn7
I0526 12:50:42.635361 1 factory.go:1251] Updating pod condition for kube-system/kube-dns-autoscaler-787d59df8f-8jgn7 to (PodScheduled==False)
我可以使用命令手动修复它,
kubectl taint nodes --all node-role.kubernetes.io/master-
但我希望在创建集群时启用它kops create cluster
谢谢