Skip to content

kubectl metrics plugin cleanup #1414

@devdattakulkarni

Description

@devdattakulkarni

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.

  1. In kubectl-metrics, remove the parameters "cr" and follow_connections.
  2. Remove commented code from kubectl-metrics
  3. 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).
  4. If crmetrics.py, delete the options for res_type = account, service, helmrelease.
  5. Update handling of input parameters as we won't be passing in the "res_type" parameter from kubectl-metrics
  6. Keep the method get_metrics_cr and only the methods that are reachable from it. Delete all the other methods.
  7. Update the parameters of the get_metrics_cr. We no longer need namespace and follow_connections parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions