How to retry image pull in a kubernetes Pods?

Dilshani Subasinghe picture Dilshani Subasinghe · Oct 26, 2016 · Viewed 99.6k times · Source

I am new to kubernetes. I have an issue in the pods. When I run the command

 kubectl get pods

Result:

NAME                   READY     STATUS             RESTARTS   AGE
mysql-apim-db-1viwg    1/1       Running            1          20h
mysql-govdb-qioee      1/1       Running            1          20h
mysql-userdb-l8q8c     1/1       Running            0          20h
wso2am-default-813fy   0/1       ImagePullBackOff   0          20h

Due to an issue of "wso2am-default-813fy" node, I need to restart it. Any suggestion?

Answer

Maciek Sawicki picture Maciek Sawicki · Jul 12, 2017

In case of not having the yaml file:

kubectl get pod PODNAME -n NAMESPACE -o yaml | kubectl replace --force -f -