Kubernetes吊舱处于待处理状态

时间:2019-03-17 15:18:12

标签: docker kubernetes kubectl

我正在尝试安装Kubectl,但是当我在终端中键入此内容时:

kubectl get pods --namespace knative-serving -w

我明白了:

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

我不明白为什么controller-66cd7d99df-q59kl仍在等待处理。

当我尝试这样做时:kubectl describe pods -n knative-serving controller-66cd7d99df-q59kl我得到了:

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.

2 个答案:

答案 0 :(得分:1)

请考虑以上评论:您已正确安装kubectl(正在运行),而kubectl describe pod/<pod>会有所帮助...

但是,您提供的信息似乎足以回答问题:

FailedScheduling因为Insufficient cpu

您显示的窗格(几个)之一请求:

cpu:     1
memory:  1000Mi

集群没有足够的能力来部署此Pod(显然还有其他Pod)。

您应该增加群集中节点的数量(和/或大小),以容纳Pod所需的容量。

您不需要删除这些Pod,因为一旦集群容量增加,您应该会看到这些Pod成功部署。

答案 1 :(得分:1)

请通过运行以下命令验证您的CPU资源:
kubectl get nodes
kubectl describe nodes (your node)
还查看与以下内容有关的所有信息:
容量:
cpu:
可分配:
cpu:

CPU请求,CPU限制信息可能会有所帮助