k3s/pkg/kubectl
Kubernetes Submit Queue 3cbb62b6bb
Merge pull request #56206 from brancz/top-metrics-s
Automatic merge from submit-queue (batch tested with PRs 56206, 58525). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl: Use metrics-server for kubectl top commands

**What this PR does / why we need it**:

This PR implements support for the kubectl top commands to use the metrics-server as an aggregated API, instead of requesting the metrics from heapster directly. If the `metrics.k8s.io` API is not served by the apiserver, then this still falls back to the previous behavior.

**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 #55489

**Special notes for your reviewer**:

As utilizing heapster as well as the v1alpha1 version of the metrics API is discouraged, I intentionally implemented the support very separated, so that once it is decided, that support is entirely removed, this will make it easy.

**Release note**:

```release-note
Support metrics API in `kubectl top` commands.
```

/cc @kubernetes/sig-instrumentation-pr-reviews @DirectXMan12 @fgrzadkowski @piosz
2018-01-23 13:17:31 -08:00
..
apply Support retainkeys strategy in new apply merge code 2017-11-02 10:00:56 -07:00
apps Add support for CronJob to kind_visitor 2017-11-10 04:22:57 +00:00
categories Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
cmd Merge pull request #56206 from brancz/top-metrics-s 2018-01-23 13:17:31 -08:00
explain Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
metricsutil kubectl: Use metrics-server for kubectl top commands 2018-01-22 21:45:06 +01:00
plugins Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
proxy Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
resource Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
scheme remove reference to v1alpha1 2017-11-21 13:00:40 -08:00
util client-go: remove import of github.com/gregjones/httpcache 2018-01-08 09:54:12 -08:00
validation Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
.import-restrictions Move scheduler code out of plugin directory. 2018-01-05 15:05:01 -08:00
BUILD remove /k8s.io/kubernetes/pkg/kubectl/testing 2018-01-03 09:39:33 +08:00
OWNERS
apply.go remove internal version api from apply 2017-12-11 13:49:39 +05:30
autoscale.go refactor kubectl autoscale to use the new generator 2017-11-20 14:12:20 +08:00
autoscale_test.go refactor kubectl autoscale to use the new generator 2017-11-20 14:12:20 +08:00
bash_comp_utils.go
clusterrolebinding.go add UT for pkg/kubecl clusterrolebinding 2017-08-28 15:13:15 +08:00
clusterrolebinding_test.go add UT for pkg/kubecl clusterrolebinding 2017-08-28 15:13:15 +08:00
configmap.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
configmap_test.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
delete.go pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
delete_test.go pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
deployment.go kubectl: deploy generators don't need to impl Generator iface 2017-07-31 12:26:17 -07:00
deployment_test.go add ut for pkg/kubectl/deployment.go 2017-08-22 11:10:21 +08:00
doc.go kubectl: rewrite docstrings in several files 2017-06-23 09:49:30 -07:00
env_file.go Relax restrictions on environment variable names. 2017-07-28 22:11:26 +02:00
env_file_test.go kubectl: refactor addFromEnvFile, write tests 2017-06-23 09:49:30 -07:00
generate.go UTs for pkg/kubectl generate_test.go 2017-08-03 21:34:03 +08:00
generate_test.go UTs for pkg/kubectl generate_test.go 2017-08-03 21:34:03 +08:00
history.go Add support for CronJob to kind_visitor 2017-11-10 04:22:57 +00:00
history_test.go Refactor HistoryViewerFor to use Visitor design pattern 2017-11-09 08:11:19 +00:00
interfaces.go
kubectl.go kubectl: Move utility functions to util package 2017-09-04 20:14:16 +10:00
namespace.go Remove kubectl create namespace dependencies on kubernetes/pkg/api 2017-10-25 20:26:11 +08:00
namespace_test.go Remove unused code in UT files in pkg/ 2018-01-15 16:02:35 +08:00
pdb.go Print type representation on errors when checking parameter types 2017-11-01 10:36:17 +01:00
pdb_test.go Print type representation on errors when checking parameter types 2017-11-01 10:36:17 +01:00
priorityclass.go add create subcommand for priorityclass 2017-11-07 15:03:01 +08:00
priorityclass_test.go add create subcommand for priorityclass 2017-11-07 15:03:01 +08:00
quota.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
quota_test.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
resource_filter.go Builder should allow moving between unstructured / versioned easily 2017-11-19 19:16:49 -05:00
resource_filter_test.go pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
rolebinding.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
rolebinding_test.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
rollback.go Trying to make error message similar to what is expected in tests 2017-11-22 06:17:44 +00:00
rollback_test.go Replace type switches in Rollback with Visitor pattern 2017-11-19 17:46:57 +00:00
rolling_updater.go pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
rolling_updater_test.go Remove unused code in UT files in pkg/ 2018-01-15 16:02:35 +08:00
rollout_status.go use extensions client with explicit version 2017-11-22 21:18:14 +08:00
rollout_status_test.go Replace some occurances of kubernetes internal api types in kubectl 2017-11-08 18:27:45 +01:00
run.go Merge pull request #54554 from zjj2wry/set-dep 2017-11-11 12:44:30 -08:00
run_test.go Enable batch/v1beta1.CronJobs by default 2017-09-03 11:17:33 +02:00
scale.go the changes introduced in this commit plumbs in the generic scaler into kubectl. 2018-01-12 09:21:18 +01:00
scale_test.go adds generic scaler to kubectl 2017-12-18 22:44:04 +01:00
secret.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
secret_for_docker_registry.go Fix problem accessing private docker registries 2017-12-20 12:37:40 -05:00
secret_for_docker_registry_test.go Fix problem accessing private docker registries 2017-12-20 12:37:40 -05:00
secret_for_tls.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
secret_for_tls_test.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
secret_test.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
service.go remove dependency from service generator 2017-10-31 15:35:36 +08:00
service_basic.go Make sure the ports is valid when parsing portString 2017-11-13 20:46:05 +08:00
service_basic_test.go Make sure the ports is valid when parsing portString 2017-11-13 20:46:05 +08:00
service_test.go remove dependency from service generator 2017-10-31 15:35:36 +08:00
serviceaccount.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
serviceaccount_test.go switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
sorting_printer.go Make metav1.(Micro)?Time functions take pointers 2017-08-17 11:24:28 +02:00
sorting_printer_test.go pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00