Dolphin
Dolphin

Reputation: 38835

how to recover pods with UnexpectedAdmissionError

My pods terminate automatic and finally I found the disk usage was 100% and auto dropped by kubernetes(v1.15.2).Now I am free disk and how to restart the UnexpectedAdmissionError pod like this:

enter image description here

I already tried this:

~ ⌚ 0:34:23
$ kubectl rollout restart deployment kubernetes-dashboard-6466b68b-z6z78
Error from server (NotFound): deployments.extensions "kubernetes-dashboard-6466b68b-z6z78" not found

do not work for me.Any suggestion?

Upvotes: 0

Views: 1646

Answers (1)

Dolphin
Dolphin

Reputation: 38835

This worked for me:

$ kubectl get pod kubernetes-dashboard-6466b68b-z6z78 -n kube-system -o yaml | kubectl replace --force -f -


pod "kubernetes-dashboard-6466b68b-z6z78" deleted
pod/kubernetes-dashboard-6466b68b-z6z78 replaced

From Documentation:

Replace a resource by filename or stdin.

JSON and YAML formats are accepted. If replacing an existing resource, the complete resource spec must be provided. This can be obtained by

$ kubectl get TYPE NAME -o yaml

It is worth checking kubectl replace --help as well.

Hope this help you.

Upvotes: 2

Related Questions