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

Add --namespace-labels, --node-labels, and --pod-labels flags #7

Merged
merged 1 commit into from
Feb 23, 2019

Conversation

oliviabarrick
Copy link

This adds new flags to kube-capacitor allowing to filter metrics by labels on
namespaces, nodes, and pods.

Any set of labels can be provided:

kube-capacity -p -u --namespace-labels "mongodb=true" --pod-labels "app=mongodb"

Labels are parsed the same way that kubectl parses them.

The cluster metrics are all fixed to be the sum of the filtered resources, so the cluster and node metrics
do not include metrics from pods that do not fit into the namespace, node or pod labels.

This adds new flags to kube-capacitor allowing to filter metrics by labels on
namespaces, nodes, and pods.

Any set of labels can be provided:

```
kube-capacity -p -u --namespace-labels "mongodb=true" --pod-labels "app=mongodb"
```

Labels are parsed the same way that kubectl parses them.

The cluster metrics are all fixed to be the sum of the filtered resources, so the cluster and node metrics
do not include metrics from pods that do not fit into the namespace, node or pod labels.
Copy link
Owner

@robscott robscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this PR! This is awesome functionality that lines up with something I was thinking of adding - nicely done. I'll get a new release out shortly.

@robscott robscott merged commit 9d7665a into robscott:master Feb 23, 2019
@oliviabarrick
Copy link
Author

Glad I could help! I’ve found this utility immensely useful already.

@robscott
Copy link
Owner

That's great to hear, thanks! These changes just got released as part of 0.2.0 - really cool to have these extra features, thanks for the help!

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

Successfully merging this pull request may close these issues.

2 participants