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 support for rolebindings #1799

Merged
merged 6 commits into from
Aug 18, 2022
Merged

Conversation

kaitoii11
Copy link
Contributor

What this PR does / why we need it:
Adds support for generating metrics for clusterrolebindings and rolebindings

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1717

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 6, 2022
@kaitoii11 kaitoii11 force-pushed the rolebinding branch 2 times, most recently from cd5d803 to c57ecbd Compare August 6, 2022 16:18
pkg/options/resource.go Outdated Show resolved Hide resolved
examples/standard/cluster-role.yaml Outdated Show resolved Hide resolved
examples/autosharding/cluster-role.yaml Outdated Show resolved Hide resolved
kaitoii11 and others added 3 commits August 10, 2022 00:36
@mrueg
Copy link
Member

mrueg commented Aug 10, 2022

/lgtm

/hold
for @dgrisonnet and @fpetkovski to review.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 10, 2022
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 10, 2022
@fpetkovski
Copy link
Contributor

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fpetkovski, kaitoii11, mrueg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -27,6 +27,7 @@ var (
// DefaultResources represents the default set of resources in kube-state-metrics.
DefaultResources = ResourceSet{
"certificatesigningrequests": struct{}{},
"clusterrolebindings": struct{}{},
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should really have these exposed by default. The use cases for this kind of metric seem really niche to me and I wouldn't want to add even more timeseries to the default setup if it is not really useful to the majority of ksm users. Same comment can be applied to the recently added role and clusterrole since they are not part of a release yet, we can still afford to remove them from the default if deemed meaningful.

Any thoughts on that @fpetkovski @mrueg?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think not exposing them by default makes sense. I agree that the amount of metrics has crept up over time and we can do a better job at providing sane defaults.

Copy link
Member

Choose a reason for hiding this comment

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

sounds good to have standard set, should we resolve that in a follow-up PR since it will affect other resources as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So for this PR, should I remove this line?

Copy link
Member

Choose a reason for hiding this comment

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

No all good, we will continue in a follow up PR!

@mrueg
Copy link
Member

mrueg commented Aug 18, 2022

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 18, 2022
@mrueg
Copy link
Member

mrueg commented Aug 18, 2022

Thanks a lot for your contribution!

@k8s-ci-robot k8s-ci-robot merged commit 3532203 into kubernetes:master Aug 18, 2022
@kaitoii11 kaitoii11 deleted the rolebinding branch August 19, 2022 01:06
@mrueg mrueg mentioned this pull request Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add metrics for role, rolebinding and serviceaccount objects
5 participants