Riby Varghese
Riby Varghese

Reputation: 111

Anyway to reload the deleted pods from kubernetics cluster

I want to reload the deleted pods from the Kubernetes cluster . Is that possible?.

Is there a way to get some details about the Kubernetes pod that was deleted (stopped, replaced by new version).

Upvotes: 0

Views: 1321

Answers (2)

Vaibhav Jain
Vaibhav Jain

Reputation: 2243

If you have a deployment object, you may fetch the last deployed versions or may rollback to previous versions based on the revision history value set in the deployment object.

As explained by @Bartosz Bilicki here How to list Kubernetes recently deleted pods? you can also fetch the data from the events.

I hope it helps.

Upvotes: 0

Daniel Marques
Daniel Marques

Reputation: 1405

There is the option -p if with you want to check the logs from terminated pods.

-p, --previous=false: If true, print the logs for the previous instance of the container in a pod if it exists.

kubectl logs -p terminated-pod-name

The pod itself is ephemeral as well as its information unless you keep them with a persistent volume you are not able to recover such information once the pod is terminated/deleted. If you need to debug the pod you can use the describe.

kubectl describe pod pod-name

Upvotes: 1

Related Questions