Alexander Trauzzi
Alexander Trauzzi

Reputation: 7405

No nodes available to schedule pods, using google container engine

I'm having an issue where a container I'd like to run doesn't appear to be getting started on my cluster.

I've tried searching around for possible solutions, but there's a surprising lack of information out there to assist with this issue or anything of it's nature.

Here's the most I could gather:

$ kubectl describe pods/elasticsearch
Name:               elasticsearch
Namespace:          default
Image(s):           my.image.host/my-project/elasticsearch
Node:               /
Labels:             <none>
Status:             Pending
Reason:             
Message:            
IP:             
Replication Controllers:    <none>
Containers:
  elasticsearch:
    Image:  my.image.host/my-project/elasticsearch
    Limits:
      cpu:      100m
    State:      Waiting
    Ready:      False
    Restart Count:  0
Events:
  FirstSeen             LastSeen            Count   From   SubobjectPath    Reason          Message
  Mon, 19 Oct 2015 10:28:44 -0500   Mon, 19 Oct 2015 10:34:09 -0500 12  {scheduler }            failedScheduling    no nodes available to schedule pods

I also see this:

$ kubectl get pod elasticsearch -o wide
NAME            READY     STATUS    RESTARTS   AGE       NODE
elasticsearch   0/1       Pending   0          5s        

I guess I'd like to know: What prerequisites exist so that I can be confident that my container is going to run in container engine? What do I need to do in this scenario to get it running?

Here's my yml file:

apiVersion: v1
kind: Pod
metadata:
  name: elasticsearch
spec:
  containers:
    - name: elasticsearch
      image: my.image.host/my-project/elasticsearch
      ports:
        - containerPort: 9200

  resources:
    volumeMounts:
      - name: elasticsearch-data
        mountPath: /usr/share/elasticsearch
  volumes:
    - name: elasticsearch-data
      gcePersistentDisk:
        pdName: elasticsearch-staging
        fsType: ext4

Here's some more output about my node:

$ kubectl get nodes
NAME                                           LABELS                                                                STATUS
gke-elasticsearch-staging-00000000-node-yma3   kubernetes.io/hostname=gke-elasticsearch-staging-00000000-node-yma3   NotReady

Upvotes: 4

Views: 12369

Answers (2)

Robert Bailey
Robert Bailey

Reputation: 18230

You only have one node in your cluster and its status in NotReady. So you won't be able to schedule any pods. You can try to determine why your node isn't ready by looking in /var/log/kubelet.log. You can also add new nodes to your cluster (scale the cluster size up to 2) or delete the node (it will be automatically replaced by the instance group manager) to see if either of those options get you a working node.

Upvotes: 5

Yu-Ju Hong
Yu-Ju Hong

Reputation: 7337

It appears that scheduler couldn't see any nodes in your cluster. You can run kubectl get nodes and gcloud compute instances list to confirm whether you have any nodes in the cluster. Did you correctly specify number of nodes (--num-nodes) when creating the cluster?

Upvotes: 1

Related Questions