pod failed to schedule. openstack over kubernates installation

9/18/2018

I am new to kubernetes and trying to deploy openstack on kubernetes cluster, below is the error I see when I try to deploy openstack. I am following the openstack docs to deploy.

kube-system   ingress-error-pages-56b4446784-crl85      0/1       Pending   0          1d
kube-system   ingress-error-pages-56b4446784-m7jrw      0/1       Pending   0          5d

I have kubernetes cluster with one master and one node running on debain9. I encounted this error during openstack installation on kubernetes.

Kubectl describe pod shows the event as below:

Events:
Type     Reason            Age                 From              Message
----     ------            ----                ----               -------
Warning  FailedScheduling  2m (x7684 over 1d)  default-scheduler  0/2 nodes are available: 1 PodToleratesNodeTaints, 2 MatchNodeSelector.

All I see is a failed scheduling, Even the container logs for kube scheduler shows it failed to schedule a pod, but doesn't say why it failed? I am kind of struck at this step from past few hours trying to debug....

PS: I am running debian9, kube version: v1.9.2+coreos.0, Docker - 17.03.1-ce

Any help appreciated ....

-- Abhi Ram
kubernetes
kubernetes-helm
openstack

1 Answer

9/18/2018

Looks like you have a toleration on your Pod and don't have nodes with the taints for those tolerations. Would help to post the definition for your Ingress and its corresponding Deployment or DaemonSet.

You would generally taint your node(s) like this:

kubectl taint nodes <your-node> key=value:IngressNode

Then on your PodSpec something like this:

tolerations:
- key: "key"
  operator: "Equal"
  value: "value"
  effect: "IngressNode"

It could also be because of missing labels on your node that your Pod needs in the nodeSelector field:

apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    env: test
spec:
  containers:
  - name: nginx
    image: nginx
    imagePullPolicy: IfNotPresent
  nodeSelector:
    cpuType: haswell

Then on you'd add a label to your node.

kubectl label nodes kubernetes-foo-node-1 cpuType=haswell

Hope it helps!

-- Rico
Source: StackOverflow