简体   繁体   English

在Kubernetes中创建pod时出错

[英]Error while creating pods in Kubernetes

I have installed Kubernetes in Ubuntu server using instructions here . 我在使用说明Ubuntu的服务器安装Kubernetes 这里 I am trying to create pods using kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --hostport=8000 --port=8080 as listed in the example. 我正在尝试使用kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --hostport=8000 --port=8080创建pods kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --hostport=8000 --port=8080如示例中所列。 However, when I do kubectl get pod I get the status of the container as pending . 但是,当我执行kubectl get pod我将容器的状态视为pending I further did kubectl describe pod for debugging and I see the message: 我进一步做了kubectl describe pod进行调试,我看到了消息:

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

I am further trying to delete this pod by kubectl delete pod hello-minikube-3383150820-1r4f7 but when I further do kubectl get pod I see another pod with prefix "hello-minikube-3383150820-" that I havent created. 我正在进一步尝试删除这个pod由kubectl delete pod hello-minikube-3383150820-1r4f7 ,但当我进一步做kubectl get pod我看到另一个带有前缀“hello-minikube-3383150820-”的pod我还没有创建。 Does anyone know how to fix this problem? 有谁知道如何解决这个问题? Thank you in advance. 先感谢您。

The PodFitsHostPorts predicate is failing because you have something else on your nodes using port 8000. You might be able to find what it is by running kubectl describe svc . PodFitsHostPorts谓词失败,因为您的节点上有其他东西使用端口8000.您可以通过运行kubectl describe svc找到它的内容。

kubectl run creates a deployment object (you can see it with kubectl describe deployments ) which makes sure that you always keep the intended number of replicas of the pod running (in this case 1). kubectl run创建一个deployment对象(您可以通过kubectl describe deployments看到它),这样可以确保始终保持pod的预期复制数(在本例中为1)。 When you delete the pod, the deployment controller automatically creates another for you. 删除窗格时,部署控制器会自动为您创建另一个窗格。 If you want to delete the deployment and the pods it keeps creating, you can run kubectl delete deployments hello-minikube . 如果要删除部署及其不断创建的pod,可以运行kubectl delete deployments hello-minikube

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM