Kubernetes pods is in status pending state

3/17/2019

I am trying to install Kubectl but when I type this in the terminal :

kubectl get pods --namespace knative-serving -w

I got this :

NAME                          READY     STATUS    RESTARTS   AGE
activator-69b8474d6b-jvzvs    2/2       Running   0          2h
autoscaler-6579b57774-cgmm9   2/2       Running   0          2h
controller-66cd7d99df-q59kl   0/1       Pending   0          2h
webhook-6d9568d-v4pgk         1/1       Running   0          2h
controller-66cd7d99df-q59kl   0/1       Pending   0         2h
controller-66cd7d99df-q59kl   0/1       Pending   0         2h
controller-66cd7d99df-q59kl   0/1       Pending   0         2h
controller-66cd7d99df-q59kl   0/1       Pending   0         2h
controller-66cd7d99df-q59kl   0/1       Pending   0         2h
controller-66cd7d99df-q59kl   0/1       Pending   0         2h

I don't understand why controller-66cd7d99df-q59kl is still pending.

When I tried this : kubectl describe pods -n knative-serving controller-66cd7d99df-q59kl I got this :

Name:           controller-66cd7d99df-q59kl
Namespace:      knative-serving
Node:           <none>
Labels:         app=controller
                pod-template-hash=66cd7d99df
Annotations:    sidecar.istio.io/inject=false
Status:         Pending
IP:             
Controlled By:  ReplicaSet/controller-66cd7d99df
Containers:
  controller:
    Image:  gcr.io/knative-releases/github.com/knative/serving/cmd/controller@sha256:5a5a0d5fffe839c99fc8f18ba028375467fdcd83cbee9c7015c1a58d01ca6929
    Port:   9090/TCP
    Limits:
      cpu:     1
      memory:  1000Mi
    Requests:
      cpu:        100m
      memory:     100Mi
    Environment:  <none>
    Mounts:
      /etc/config-logging from config-logging (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from controller-token-d9l64 (ro)
Conditions:
  Type           Status
  PodScheduled   False 
Volumes:
  config-logging:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      config-logging
    Optional:  false
  controller-token-d9l64:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  controller-token-d9l64
    Optional:    false
QoS Class:       Burstable
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  40s (x98 over 2h)  default-scheduler  0/1 nodes are available: 1 Insufficient cpu.
-- Bruce Peter
docker
kubectl
kubernetes

2 Answers

3/17/2019

Please consider the comments above: you have kubectl installed correctly (it's working) and kubectl describe pod/<pod> would help...

But, the information you provide appears sufficient for an answer:

FailedScheduling because of Insufficient cpu

The pod that you show (one of several) requests:

cpu:     1
memory:  1000Mi

The cluster has insufficient capacity to deploy this pod (and apparently the others).

You should increase the number (and|or size) of the nodes in your cluster to accommodate the capacity needed for the pods.

You needn't delete these pods because, once the cluster's capacity increases, you should see these pods deploy successfully.

-- DazWilkin
Source: StackOverflow

3/17/2019

Please verify your cpu resources by running:
kubectl get nodes
kubectl describe nodes (your node)
take a look also for all information related to:
Capacity:
cpu:
Allocatable:
cpu:

CPU Requests, CPU Limits information can be helpful

-- Hanx
Source: StackOverflow