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

kubectl applogs cleanup #1372

Open
devdattakulkarni opened this issue Nov 15, 2024 · 1 comment · May be fixed by #1374
Open

kubectl applogs cleanup #1372

devdattakulkarni opened this issue Nov 15, 2024 · 1 comment · May be fixed by #1374

Comments

@devdattakulkarni
Copy link
Contributor

devdattakulkarni commented Nov 15, 2024

KubePlus kubectl-applogs plugin retrieves the container logs for all the Pods corresponding to an application instance.

The implementation of this plugin has gone through several iterations. It's original design was to first discover all the Pods starting from the input Custom resource instance. For this it traversed the object graph starting from the input Custom resource instance and discovering all the objects, then following their appropriate connections (labels, env vars, spec properties, annotations), to find out other resources that are connected to the Custom resource instance, then trying to find Pods from those resources, and so on. This was before KubePlus created separate Namespace for deploying a Custom resource instance.

Once Namespace-level isolation was implemented in KubePlus, where each Custom Resource instance will be deployed in its own Namespace, figuring out what Pods belong to that Custom Resource instance, became easy. All we had to do was to find out all the Pods in the NS corresponding to that CR instance. We no longer needed traversing the object graph.

However, the applogs code still has references to the earlier design. For instance, the first parameter to crlogs.py is defaulted to "connection" (https://github.com/cloud-ark/kubeplus/blob/master/plugins/kubectl-applogs#L72), but it is not really used (https://github.com/cloud-ark/kubeplus/blob/master/plugins/crlogs.py#L93).

Let's cleanup kubectl-applogs and crlogs.py for such unused code.

Let's delete any functions that are not being used.

@devdattakulkarni
Copy link
Contributor Author

cc: @rahulkumar-choudhary

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

Successfully merging a pull request may close this issue.

1 participant