[英]Kubernetes pods won't start even though node is a ready state
我是kubernetes的新手,我正努力开始我的第一批豆荚。 我在Ubuntu虚拟机上安装了kubernetes,然后继续
kubeadm init
其次是其他指示
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/
我可以看到该节点已启动并正在运行
kubectl get nodes
NAME STATUS ROLES AGE VERSION
vm24740 Ready master 12m v1.10.0
但是,我的豆荚无法启动:
kubectl get pods
NAME READY STATUS RESTARTS AGE
myappdeployment-588bc8ddf4-28jzj 0/1 Pending 0 11m
myappdeployment-588bc8ddf4-9bbb9 0/1 Pending 0 11m
myappdeployment-588bc8ddf4-fptft 0/1 Pending 0 11m
myappdeployment-588bc8ddf4-lxj8p 0/1 Pending 0 11m
myappdeployment-588bc8ddf4-xhg5f 0/1 Pending 0 11m
这是吊舱的详细视图:
kubectl describe pod myappdeployment-588bc8ddf4-28jzj
Name: myappdeployment-588bc8ddf4-28jzj
Namespace: default
Node: <none>
Labels: app=myapp
pod-template-hash=1446748890
Annotations: <none>
Status: Pending
IP:
Controlled By: ReplicaSet/myappdeployment-588bc8ddf4
Containers:
myapp:
Image: jamesquigley/exampleapp:v1.0.0
Port: 9000/TCP
Host Port: 0/TCP
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-6rcjb (ro)
Conditions:
Type Status
PodScheduled False
Volumes:
default-token-6rcjb:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-6rcjb
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 1m (x37 over 11m) default-scheduler 0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.
有没有比我更有经验的人,为什么吊舱无法启动?
似乎您正在运行单节点(主节点)k8:
从文档 :
主隔离
默认情况下,出于安全原因,您的群集不会在主服务器上调度Pod。 如果您希望能够在主服务器上调度Pod,例如对于单机Kubernetes集群进行开发,请运行:
kubectl taint nodes --all node-role.kubernetes.io/master-
输出看起来像这样:
node "test-01" untainted taint key="dedicated" and effect="" not found. taint key="dedicated" and effect="" not found
node "test-01" untainted taint key="dedicated" and effect="" not found. taint key="dedicated" and effect="" not found
。这将从拥有该节点的任何节点(包括主节点)中删除
the node-role.kubernetes.io/master
污点,这意味着调度程序将能够在任何地方调度pod。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.