Search code examples
kubernetesrelease-management

Get K8s deployment logs for a specific release


Is there a way that I can get release logs for a particular K8s release within my K8s cluster as the replica-sets related to that deployment is no longer serving pods?

For an example kubectl rollout history deployment/pod1-dep would result

1

2 <- failed deploy

3 <- Latest deployment successful

If I want to pick the logs related to events in 2, would it be a possible task, or is there a way that we can such functionality with this.


Solution

  • This is a Community Wiki answer, posted for better visibility, so feel free to edit it and add any additional details you consider important.

    As David Maze rightly suggested in his comment above:

    Once a pod is deleted, its logs are gone with it. If you have some sort of external log collector that will generally keep historical logs for you, but you needed to have set that up before you attempted the update.

    So the answer to your particular question is: no, you can't get such logs once those particular pods are deleted.