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

Enable HPA metrics REST clients by default #52553

Conversation

DirectXMan12
Copy link
Contributor

Now that the metrics APIs are in beta and metrics-server has the appropriate support (as of #52548), we should enable the REST metrics clients by default instead of using the legacy clients.

The --horizontal-pod-autoscaler-use-rest-clients flag now defaults to true.  You must have metrics-server enabled for this to work.

piosz and others added 3 commits September 15, 2017 16:38
Since metrics-server now is deployable and supports
metrics.k8s.io/v1beta1, we should enable usage of the REST clients by
default.
This commit disables using the HPA metrics REST clients in favor of the
legacy clients if metrics-server is not deployed.
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 15, 2017
@DirectXMan12
Copy link
Contributor Author

/cc @luxas @piosz

@k8s-ci-robot k8s-ci-robot requested review from luxas and piosz September 15, 2017 15:44
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 15, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: DirectXMan12
We suggest the following additional approver: mikedanese

Assign the PR to them by writing /assign @mikedanese in a comment when ready.

Associated issue: 52548

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 release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 15, 2017
@piosz
Copy link
Member

piosz commented Sep 15, 2017

Test failures look real.

Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

Kind of LGTM, but the other PR has to be merged first.
Also I want to know what the upgrade scenario looks like.
Can this break any user in any condition?

cc @kubernetes/sig-autoscaling-pr-reviews @kubernetes/sig-auth-pr-reviews (for RBAC changes)
@kubernetes/sig-api-machinery-pr-reviews (for the API group changes)

FYI @kubernetes/kubernetes-release-managers

@luxas luxas added this to the v1.8 milestone Sep 15, 2017
Since we weren't running the HPA with metrics REST clients by default,
we had no bootstrap policy enabling the HPA controller to talk to the
metrics APIs.

This adds permissions for the HPA controller to talk list
pods.metrics.k8s.io, and list any resource in custom.metrics.k8s.io.
@DirectXMan12 DirectXMan12 force-pushed the feature/enable-hpa-rest-clients-by-default branch from 9e87e19 to f4bc71b Compare September 15, 2017 21:26
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 15, 2017
@DirectXMan12
Copy link
Contributor Author

So, the story on upgrades is this: previously, since this flag was off by default, if you didn't pass this flag explicitly, your HPA controller would fetch metrics by directly connecting to Heapster over legacy API paths.

After this PR, by default, the HPA controller tries to look for metrics by checking the API at metrics.k8s.io, via the "main" API server (which in turn uses aggregation). Thus, while doing the upgrade, you'd either have to start up metrics server (now run by default in the 1.8 kube-up), or explicitly set this flag to false. If you don't do one of those two, your HPA won't work.

@DirectXMan12
Copy link
Contributor Author

We'd meant to actually put this PR in earlier in the release, but were delayed by some repository synchronization issues -- in order for things to pass tests, we needed a properly updated version of metrics server.

@ericchiang
Copy link
Contributor

ericchiang commented Sep 15, 2017

After this PR, by default, the HPA controller tries to look for metrics by checking the API at metrics.k8s.io, via the "main" API server (which in turn uses aggregation). Thus, while doing the upgrade, you'd either have to start up metrics server (now run by default in the 1.8 kube-up), or explicitly set this flag to false. If you don't do one of those two, your HPA won't work.

This sounds like a breaking change. Were there notices in the last release about deprecating the current behavior?

@DirectXMan12
Copy link
Contributor Author

This sounds like a breaking change. Where there notices in the last release about deprecating the current behavior?

@ericchiang The intention was there in the original PR that introduced this functionality, but unfortunately, looking over the previous iteration's release notes, the wording did not actually get into the release notes :-/. I'd love to have this enabled by default this release, but I understand if we have to wait until next.

@DirectXMan12
Copy link
Contributor Author

/retest

@ericchiang
Copy link
Contributor

ericchiang commented Sep 15, 2017

Okay, per our deprecation policy it sounds likes we need to announce the existing behavior as deprecated for a release before changing the default.

https://kubernetes.io/docs/reference/deprecation-policy/

Removing this from the milestone and adding #52572 to the milestone in its place.

@ericchiang ericchiang modified the milestones: v1.8, v1.9 Sep 15, 2017
@luxas
Copy link
Member

luxas commented Sep 16, 2017

I also agree with @ericchiang (although I'd like to see this personally)
However, @DirectXMan12 please announce this time in the relnotes that this is gonna change 😄

@DirectXMan12
Copy link
Contributor Author

However, @DirectXMan12 please announce this time in the relnotes that this is gonna change 😄

Done :-)

@mwielgus
Copy link
Contributor

What is the status of this PR?

@luxas
Copy link
Member

luxas commented Sep 27, 2017

/retest
@mwielgus We should now merge this PR, code freeze has lifted.

@luxas
Copy link
Member

luxas commented Sep 27, 2017

@DirectXMan12 You broke out some of this code to other PRs, right?

@k8s-ci-robot
Copy link
Contributor

@DirectXMan12: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-bazel f4bc71b link /test pull-kubernetes-e2e-gce-bazel
pull-kubernetes-e2e-gce-etcd3 f4bc71b link /test pull-kubernetes-e2e-gce-etcd3

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@luxas
Copy link
Member

luxas commented Oct 28, 2017

@DirectXMan12 What's the status of this PR?

@DirectXMan12
Copy link
Contributor Author

This got enabled as part of #53205. Closing this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants