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

Graduate metrics/v1alpha1 to v1beta1 #51653

Merged

Conversation

DirectXMan12
Copy link
Contributor

@DirectXMan12 DirectXMan12 commented Aug 30, 2017

This introduces v1beta1 of the resource metrics API, previously in alpha.
The v1alpha1 version remains for compatibility with the Heapster legacy version
of the resource metrics API, which is compatible with the v1alpha1 version. It also
renames the v1beta1 version to resource-metrics.metrics.k8s.io.

The HPA controller's REST clients (but not the legacy client) have been migrated as well.

Part of kubernetes/enhancements#118.

Migrate the metrics/v1alpha1 API to metrics/v1beta1.  The HorizontalPodAutoscaler
controller REST client now uses that version.  For v1beta1, the API is now known as
resource-metrics.metrics.k8s.io.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 30, 2017
@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 Aug 30, 2017
@DirectXMan12
Copy link
Contributor Author

cc @kubernetes/sig-instrumentation-api-reviews
@kubernetes/sig-autoscaling-api-reviews

cc @piosz

@k8s-ci-robot k8s-ci-robot added sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 30, 2017
@smarterclayton
Copy link
Contributor

Is there a feature issue to attach to this?

@DirectXMan12
Copy link
Contributor Author

Whoops, yep, will do -- it's part of kubernetes/enhancements#118 ("the master metrics API... needs to be stabilized").

@DirectXMan12
Copy link
Contributor Author

/retest

@DirectXMan12
Copy link
Contributor Author

let's see if that actually kicks the tests off -- it's been sitting here for a day, not doing anything

@DirectXMan12 DirectXMan12 force-pushed the versions/metrics-v2beta1 branch from b6221aa to 5b8f083 Compare August 31, 2017 21:54
@smarterclayton
Copy link
Contributor

So other than the name of the group I don't see any issues here with API. Will need sig approval and LGTM though.

@@ -22,7 +22,7 @@ import (
)

// GroupName is the group name use in this package
const GroupName = "metrics"
const GroupName = "resource-metrics.metrics.k8s.io"
Copy link
Member

Choose a reason for hiding this comment

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

Why not having just metrics.k8s.io. metrics.metrics sounds weird to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have custom-metrics.metrics.k8s.io, so it just seemed strange to use it as both a "namespace" for groups and a group itself. This would make it resource-metrics.metrics and custom-metrics.metrics, so they match.

Copy link
Member

Choose a reason for hiding this comment

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

can we have:
metrics.k8s.io for resource metrics
custom.metrics.k8s.io for custom metrics?

@smarterclayton
Copy link
Contributor

Yeah those groups sound fine to me.

@smarterclayton
Copy link
Contributor

We can get a release exception if that goes past code freeze since this would be new APIs, so if we generally agree on the shorter names we should do that for 1.8

// +k8s:deepcopy-gen=package,register

// +groupName=resource-metrics.metrics.k8s.io
Copy link
Contributor

Choose a reason for hiding this comment

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

How was group name decided? Is there a reason to stutter? "resource.metrics.k8s.io" is shorter

Copy link
Contributor

Choose a reason for hiding this comment

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

(this was my old comment that was not committed).

I'd prefer metrics.k8s.io and custom.metrics.k8s.io

@piosz
Copy link
Member

piosz commented Sep 1, 2017

@smarterclayton which group names sound fine for you?

@smarterclayton
Copy link
Contributor

metrics.k8s.io for resource metrics
custom.metrics.k8s.io for custom metrics?

SGTM

@piosz
Copy link
Member

piosz commented Sep 1, 2017

@smarterclayton cool
@DirectXMan12 WDYT?

@piosz piosz self-assigned this Sep 1, 2017
@@ -215,7 +214,8 @@ func Convert_batch_JobTemplate_To_v1beta1_JobTemplate(in *batch.JobTemplate, out

func autoConvert_v1beta1_JobTemplateSpec_To_batch_JobTemplateSpec(in *v1beta1.JobTemplateSpec, out *batch.JobTemplateSpec, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := batch_v1.Convert_v1_JobSpec_To_batch_JobSpec(&in.Spec, &out.Spec, s); err != nil {
// TODO: Inefficient conversion - can we improve it?
Copy link
Member

Choose a reason for hiding this comment

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

Is this change intended? Looks weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, it's not. It's weird that the conversion-gen changed it...

@@ -59,6 +59,7 @@ openapi_library(
"k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1",
"k8s.io/metrics/pkg/apis/custom_metrics/v1alpha1",
"k8s.io/metrics/pkg/apis/metrics/v1alpha1",
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be removed?

@@ -98,6 +98,7 @@ func New() *Generator {
`k8s.io/api/networking/v1`,
`k8s.io/kubernetes/federation/apis/federation/v1beta1`,
`k8s.io/metrics/pkg/apis/metrics/v1alpha1`,
Copy link
Member

Choose a reason for hiding this comment

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

same here

)

// GroupName is the group name use in this package
const GroupName = "metrics"
Copy link
Contributor

Choose a reason for hiding this comment

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

metrics.k8s.io?

@smarterclayton
Copy link
Contributor

/approve

Names custom.metrics.k8s.io and metrics.k8s.io. The other APIs you are promoting look fine.

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2017
@DirectXMan12 DirectXMan12 force-pushed the versions/metrics-v2beta1 branch from bc506b3 to c571aac Compare September 1, 2017 23:54
@sjenning
Copy link
Contributor

sjenning commented Sep 2, 2017

/retest

@sjenning
Copy link
Contributor

sjenning commented Sep 2, 2017

Wait... when did kops drop off the required list?! I'm not complaining; it was blocking the world. Just didn't notice before I started the retest.

@liggitt
Copy link
Member

liggitt commented Sep 2, 2017

It is non-blocking while they work out why it wasn't running tests using the test code from the PR being tested

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 3, 2017
k8s-github-robot pushed a commit that referenced this pull request Sep 4, 2017
Automatic merge from submit-queue (batch tested with PRs 49727, 51792)

Introducing metrics-server

ref kubernetes/enhancements#271

There is still some work blocked on problems with repo synchronization:
- migrate to `v1beta1` introduced in #51653 
- bump deps to HEAD
Will do it in a follow up PRs once the issue is resolved.

```release-note
Introduced Metrics Server
```
This commit graduates them resource metrics API from v1alpha1
to v1beta1.
This commit updates the REST metrics client to use metrics/v1beta1.
The legacy client still uses metrics/v1alpha1.
This commit renames metrics to metrics.k8s.io
for the v1beta1 version, to give it a properly namespaced name which
mirrors custom.metrics.k8s.io.
@DirectXMan12 DirectXMan12 force-pushed the versions/metrics-v2beta1 branch from c571aac to e1a22e8 Compare September 5, 2017 20:12
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 5, 2017
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Sep 5, 2017

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

Test name Commit Details Rerun command
pull-kubernetes-e2e-kops-aws e1a22e8 link /test pull-kubernetes-e2e-kops-aws

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.

@smarterclayton
Copy link
Contributor

@piosz is there an active release exception covering this yet?

This is API approved

@piosz piosz added this to the v1.8 milestone Sep 6, 2017
@piosz
Copy link
Member

piosz commented Sep 6, 2017

@smarterclayton I don't know how the exception process works but my feeling is that it was reviewed and approved before the code freeze.

@piosz
Copy link
Member

piosz commented Sep 6, 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 Sep 6, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DirectXMan12, piosz, smarterclayton

Associated issue: 118

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
Copy link

Automatic merge from submit-queue (batch tested with PRs 51603, 51653)

@k8s-github-robot k8s-github-robot merged commit 0076f02 into kubernetes:master Sep 6, 2017
@piosz
Copy link
Member

piosz commented Sep 6, 2017

Ups. I unintentionally triggered merge. We can consider reverting this if people disagree with my #51653 (comment).

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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. 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.

7 participants