Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Use types from k8s.io/metrics #1537

Merged
merged 8 commits into from
Feb 27, 2017

Conversation

DirectXMan12
Copy link
Contributor

@DirectXMan12 DirectXMan12 commented Feb 20, 2017

This PR changes Heapster over to the types from k8s.io/metrics when serving metrics from the API server.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 20, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@DirectXMan12 DirectXMan12 force-pushed the feature/use-cm-types branch 3 times, most recently from b1678bb to a91b6f3 Compare February 24, 2017 05:43
@DirectXMan12 DirectXMan12 changed the title [WIP] Use types from k8s.io/metrics Use types from k8s.io/metrics Feb 24, 2017
@DirectXMan12 DirectXMan12 force-pushed the feature/use-cm-types branch 2 times, most recently from e769263 to b4742f6 Compare February 24, 2017 18:06
This commit contains the Heapster code changes required to rebase
Heapster onto the latest Kubernetes.  This begins to move away from
making use of `k8s.io/kubernetes` proper, instead favoring
`k8s.io/client-go`, `k8s.io/apimachinery`, and `k8s.io/apiserver`.
This should make future updates easier.
This commit continues the work of the previous commit, rebasing
the generic-API-server-based code in Heapster to use the latest
copy of generic API server, and to follow the proper conventions,
including switching over to just use webhook authentication.
Heapster doesn't work with versions of Kubernetes that don't have
the summary API anymore, so we can remove the version detection and
fallback logic.
We only need a small part of the Kubelet client which just wraps
the normal REST client config.  By doing this, we can avoid vendoring
much more of Kubernetes.

With this, the only remaining use of the vendored Kubernetes is the
Kubelet stats API.
@DirectXMan12
Copy link
Contributor Author

cc @piosz PTAL

This commit switches over the API server to use the metrics API
types from k8s.io/metrics.  It leaves the legacy APIs using the built-in
types.
This commit adds k8s.io/metrics to Godeps/the vendor directory,
as needed by the previous commit.
@DirectXMan12
Copy link
Contributor Author

client-go finally synced, so this is unblocked

@piosz
Copy link
Contributor

piosz commented Feb 27, 2017

LGTM, thanks a lot for doing it!

@piosz piosz added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2017
@piosz piosz merged commit b0a73e1 into kubernetes-retired:master Feb 27, 2017
@DirectXMan12 DirectXMan12 deleted the feature/use-cm-types branch February 27, 2017 16:57
k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this pull request Mar 1, 2017
Automatic merge from submit-queue

HPA Controller: Use Custom Metrics API

This commit switches over the HPA controller to use the custom metrics
API.  It also converts the HPA controller to use the generated client
in k8s.io/metrics for the resource metrics API.

In order to enable support, you must enable
`--horizontal-pod-autoscaler-use-rest-clients` on the
controller-manager, which will switch the HPA controller's MetricsClient
implementation over to use the standard rest clients for both custom
metrics and resource metrics.  This requires that at the least resource
metrics API is registered with kube-aggregator, and that the controller
manager is pointed at kube-aggregator.  For this to work, Heapster
must be serving the new-style API server (`--api-server=true`).

Before this merges, this will need kubernetes/metrics#2 to merge, and a godeps update to pull that in.
It's also semi-dependent on kubernetes-retired/heapster#1537, but that is not required in order for this to merge.

**Release note**:
```release-note
Allow the Horizontal Pod Autoscaler controller to talk to the metrics API and custom metrics API as standard APIs.
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants