Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get pod logs associated with a owner resource #3054

Open
aslafy-z opened this issue Jan 10, 2025 · 5 comments
Open

Get pod logs associated with a owner resource #3054

aslafy-z opened this issue Jan 10, 2025 · 5 comments

Comments

@aslafy-z
Copy link
Contributor




Is your feature request related to a problem? Please describe.
When I run a multi step argo workflow and want to see logs for each steps, I have to dig them from all pods, one after the other, following the dag flow.

Describe the solution you'd like
I'd love to see all pod logs from an argo-workflows workflow, like I can do with deployments for example, using the l command.

Describe alternatives you've considered
Use stern with the workflow label, but it makes me go out of k9s, which is not good ux.

Additional context
argo-workflows Workflow resource is the owner of the pods. Maybe there's a way to tail logs from a resource descendant pods so the implementation is not specific to argo-workflows but to any other tool with the same setup.

@KevinGimbel
Copy link

I feel like this is a very Argo specific request. stern definitely works as alternative, and you could use the stern-plugin for k9s.

Would this work for you? You could see all the logs together and start stern from within k9s, then go right back into k9s when you close the log view.

@aslafy-z
Copy link
Contributor Author

I disagree that this is specific to argo workflows. There are other external pod controllers out there that could inherit from this functionality. Stern only tails from a pod name pattern / pod label selector afaik.

@KevinGimbel
Copy link

There are other external pod controllers out there that could inherit from this functionality

OK, so how does Argo connect Kubernetes objects to Workflows? I'd assume they have a label (like pods started by a replica set get a specific label).

I'm not against implementing something Argo specific; k9s already supports Helm natively so supporting Argo (which is a popular tool as well) seems OK to me.

@aslafy-z
Copy link
Contributor Author

So yeah, what I meant by descendent pods are pods on which the owner reference is set to the tracked resource (in my case, the workflow).

@aslafy-z
Copy link
Contributor Author

aslafy-z commented Jan 21, 2025

AFAIK, Kubernetes doesn't natively support automatically discovering owned resources, as discussed in these related issues:

kubernetes/kubernetes#54498

kubernetes/client-go#1085

kubernetes/kubectl#1292

The existing https://github.com/ahmetb/kubectl-tree plugin can serve as a reference, as it already implements this functionality. However, integrating it directly into the k9s code would need careful consideration, especially regarding performance.

Instead of a general implementation, focusing on an Argo Workflow-specific feature might simplify the integration and reduce complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants