Useful shortcuts for vi editor

Thursday, 4 October 2018

How to solve "restarting/pending pod repeatedly" problem?

-> Check the pods status
e.g.
# kubectl get pods --all-namespaces
NAMESPACE     NAME                            READY     STATUS
kube-system   coredns-78fcdf6894-6ggkk        0/1       Pending
kube-system   coredns-78fcdf6894-tm52r        0/1       Pending 

-> Check the deployments
# kubectl get deployment --all-namespaces
NAMESPACE     NAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE
kube-system   coredns   2         2         2            0

-> Needs to remove the deployments related to pod and service
e.g.
# kubectl delete deployment coredns -n kube-system
deployment.extensions "coredns" deleted