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

Kubernetes pod gets recreated when deleted

You need to delete the deployment, which should in turn delete the pods and the replica sets https://github.com/kubernetes/kubernetes/issues/24137 To list all deployments: kubectl get deployments –all-namespaces Then to delete the deployment: kubectl delete -n NAMESPACE deployment DEPLOYMENT Where NAMESPACE is the namespace it’s in, and DEPLOYMENT is the name of the deployment. If NAMESPACE is … Read more

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 … Read more

tech