在 Kubernetes 中创建 Pod 时出错

rmb*_*rmb 5 kubernetes google-kubernetes-engine

我已使用此处的说明在 Ubuntu 服务器中安装了 Kubernetes 。我正在尝试使用kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --hostport=8000 --port=8080示例中列出的方法创建 pod 。但是,当我这样做时,我kubectl get pod将容器的状态设为pending. 我进一步进行kubectl describe pod了调试,并看到了以下消息:

FailedScheduling pod (hello-minikube-3383150820-1r4f7) failed to fit in any node fit failure on node (minikubevm): PodFitsHostPorts.

我进一步尝试删除这个 pod,kubectl delete pod hello-minikube-3383150820-1r4f7 但是当我进一步删除时,kubectl get pod我看到另一个带有前缀“hello-minikube-3383150820-”的 pod,我还没有创建。有谁知道如何解决这个问题?先感谢您。

CJ *_*len 3

谓词PodFitsHostPorts失败,因为您的节点上有其他东西使用端口 8000。您也许可以通过运行 来找到它是什么kubectl describe svc

kubectl run创建一个deployment对象(您可以使用 来查看它kubectl describe deployments),以确保您始终保持运行的 pod 副本的预期数量(在本例中为 1)。当您删除 pod 时,部署控制器会自动为您创建另一个 pod。如果您想删除部署及其不断创建的 Pod,您可以运行kubectl delete deployments hello-minikube.