I have installed Kubernetes in Ubuntu server using instructions here. 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. However, when I do kubectl get pod
I get the status of the container as pending
. I further did kubectl describe pod
for debugging and I see the message:
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. 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
.
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). 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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With