我正在尝试安装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.发布于 2019-03-18 00:19:53
请考虑上面的评论:你已经正确安装了kubectl (它正在工作),kubectl describe pod/<pod>会有帮助的……
但是,您提供的信息似乎足以给出答案:
由于Insufficient cpu而导致的FailedScheduling
您显示的pod (几个之一)请求:
cpu: 1
memory: 1000Mi集群没有足够的容量来部署这个pod (显然还有其他pod)。
您应该增加集群中节点的数量(和|或大小),以适应pods所需的容量。
您不需要删除这些pod,因为一旦集群的容量增加,您应该会看到这些pod部署成功。
发布于 2019-03-18 00:45:55
请通过运行以下命令验证您的cpu资源:
kubectl get nodes
kubectl describe nodes (your node)
还可以查看与以下内容相关的所有信息:
容量:
cpu:
可分配的:
cpu:
CPU请求、CPU限制信息可能会有所帮助
https://stackoverflow.com/questions/55208598
复制相似问题