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

Allow HPA to get custom metrics #54854

Merged
merged 1 commit into from
Nov 8, 2017
Merged

Conversation

kawych
Copy link
Contributor

@kawych kawych commented Oct 31, 2017

What this PR does / why we need it:
This PR allows HPA to read custom metrics.

Release note:

Allow HPA to read custom metrics.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 31, 2017
@kawych
Copy link
Contributor Author

kawych commented Oct 31, 2017

/unassign @deads2k
/assign @fgrzadkowski

@@ -162,7 +162,7 @@ func buildControllerRoles() ([]rbac.ClusterRole, []rbac.ClusterRoleBinding) {
rbac.NewRule("get").Groups(legacyGroup).Resources("services/proxy").Names("https:heapster:", "http:heapster:").RuleOrDie(),
// allow listing resource metrics and custom metrics
rbac.NewRule("list").Groups(resMetricsGroup).Resources("pods").RuleOrDie(),
Copy link
Member

Choose a reason for hiding this comment

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

get needed here 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.

I think this is not necessary - HPA uses this API since PR #53205 and works fine, i.e. e2e tests are passing. See [HPA] tests here: https://k8s-testgrid.appspot.com/google-gce#gci-gce

@liggitt
Copy link
Member

liggitt commented Oct 31, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 31, 2017
@kawych
Copy link
Contributor Author

kawych commented Nov 6, 2017

/retest

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 8, 2017
@kawych
Copy link
Contributor Author

kawych commented Nov 8, 2017

/assign @mwielgus

@mwielgus
Copy link
Contributor

mwielgus commented Nov 8, 2017

/lgtm

@mwielgus
Copy link
Contributor

mwielgus commented Nov 8, 2017

@liggitt Could you please approve this PR?

@liggitt
Copy link
Member

liggitt commented Nov 8, 2017

already done

@kawych
Copy link
Contributor Author

kawych commented Nov 8, 2017

@liggitt
I think I need "/approve no-issue" from you. Thanks.

@deads2k
Copy link
Contributor

deads2k commented Nov 8, 2017

/approve no-issue

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, kawych, liggitt, mwielgus

Associated issue requirement bypassed by: deads2k

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2017
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 648cc30 into kubernetes:master Nov 8, 2017
k8s-github-robot pushed a commit that referenced this pull request Nov 12, 2017
…-upstream-release-1.8

Automatic merge from submit-queue.

Automated cherry pick of #54854

Cherry pick of #54854 on release-1.8.

#54854: Allow HPA to get custom metrics
@@ -162,7 +162,7 @@ func buildControllerRoles() ([]rbac.ClusterRole, []rbac.ClusterRoleBinding) {
rbac.NewRule("get").Groups(legacyGroup).Resources("services/proxy").Names("https:heapster:", "http:heapster:").RuleOrDie(),
// allow listing resource metrics and custom metrics
rbac.NewRule("list").Groups(resMetricsGroup).Resources("pods").RuleOrDie(),
rbac.NewRule("list").Groups(customMetricsGroup).Resources("*").RuleOrDie(),
rbac.NewRule("get", "list").Groups(customMetricsGroup).Resources("*").RuleOrDie(),
Copy link
Member

Choose a reason for hiding this comment

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

FWIW "watch" seems to be missing here - while it was there in the original role (https://github.com/GoogleCloudPlatform/k8s-stackdriver/pull/65/files)

Copy link
Member

Choose a reason for hiding this comment

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

no objection to the permission, but does the custom metrics server support watch?

Copy link
Member

Choose a reason for hiding this comment

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

Guess it's a question for @kawych :)

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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants