kubectl apply vs kubectl create?

Those are two different approaches: Imperative Management kubectl create is what we call Imperative Management. On this approach you tell the Kubernetes API what you want to create, replace or delete, not how you want your K8s cluster world to look like. Declarative Management kubectl apply is part of the Declarative Management approach, where changes that you may have applied … Read more

kubectl get pods shows ErrImagePull

Reason This is because it can’t download the docker image defined in your pod definition file. By default it downloads required images from DockerHub. Way 1 So after creating your my-first-image:3.0.0 image you have to publish it at DockerHub. For that create an account at DockerHub and login from terminal using login command After successful login, rebuild your docker image … Read more

Restart container within pod

Is it possible to restart a single container Not through kubectl, although depending on the setup of your cluster you can “cheat” and docker kill the-sha-goes-here, which will cause kubelet to restart the “failed” container (assuming, of course, the restart policy for the Pod says that is what it should do) how do I restart … Read more