kubectl metrics plugin has gone through several updates. It used to support retrieving metrics for a Service instance, Servcie Account, Helm release, building object graph to get all application Pods, and then using those for finding metrics, etc. Some of these features are no longer supported. This issue is to track the cleanup of this plugin. Specifically, we should make following changes to this plugin.
- In kubectl-metrics, remove the parameters "cr" and follow_connections.
- Remove commented code from kubectl-metrics
- In the help message, add description for the parameters. Specially, for the
<Namespace> parameter, include description that this is the Namespace in which the <Instance> is deployed. (Note that the <Namespace> of the instance is the same <Namespace> where the corresponding resourcecomposition instance is created. And that is same as the <Namespace> in which KubePlus is installed. So then do we really need this parameter? The plugin can find out KubePlus namespace on its end. In fact, not requiring the <Namespace> parameter will make the plugin more intuitive since from usage pov, providing the app name and Kind name should be enough to get the metrics for that app instance).
- If crmetrics.py, delete the options for res_type = account, service, helmrelease.
- Update handling of input parameters as we won't be passing in the "res_type" parameter from kubectl-metrics
- Keep the method get_metrics_cr and only the methods that are reachable from it. Delete all the other methods.
- Update the parameters of the get_metrics_cr. We no longer need namespace and follow_connections parameters.
kubectl metrics plugin has gone through several updates. It used to support retrieving metrics for a Service instance, Servcie Account, Helm release, building object graph to get all application Pods, and then using those for finding metrics, etc. Some of these features are no longer supported. This issue is to track the cleanup of this plugin. Specifically, we should make following changes to this plugin.
<Namespace>parameter, include description that this is the Namespace in which the<Instance>is deployed. (Note that the<Namespace>of the instance is the same<Namespace>where the corresponding resourcecomposition instance is created. And that is same as the<Namespace>in which KubePlus is installed. So then do we really need this parameter? The plugin can find out KubePlus namespace on its end. In fact, not requiring the<Namespace>parameter will make the plugin more intuitive since from usage pov, providing the app name and Kind name should be enough to get the metrics for that app instance).