-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Resource Metrics API (metrics-server) #398
Comments
Our out of the box install is currently kubeadm + cni. I'd want to know why kubeadm doesn't configure it by default first 🤔 |
I really want to replace my local Minikube environment with kind and the Metrics API is essential for this to happen 😄 I would also be fine with the Metrics API being an "addon" which can be easily enabled via |
try the manifests from here: but kubeadm is not bundling metrics support, because the kubeadm cluster is a minimal viable one - i.e. no addons except kube-proxy and a DNS server. /triage support |
@neolit123 thanks for the hint, but that manifest (which runs the old v0.2.1 of metrics server btw) also did not work for me. The error from metrics server:
I'm confused on what the correct way to fix this is: apparently the old version of metrics server (v0.2.1) is still the way to go? The flags differ between the current (v0.3.1) and the old version (v0.2.1), also not sure if I need to additionally deploy cadvisor (e.g. like here)? Hoping for someone more knowledgeable than me to help here 😄 |
sorry, I'm not particularly familiar with this, I'll see if I can find someone who is |
those manifests are old, try these for 0.3.1: |
@neolit123 I tried the 0.3.1 manifests before and did not succeed so far 😞 |
@hjacobs args:
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP |
@bugbuilder yeah! That (adding the two args) worked with the official metrics server manifests in https://github.com/kubernetes-incubator/metrics-server/tree/master/deploy/1.8%2B 🎉
|
kube-ops-view now also works fine on kind 🎉 |
So how can we get the Resource Metrics API deployment packaged into the default kind cluster creation (or as addon)? |
I created a gist for the working Metrics Server API deployment manifests, so anybody can just try it out:
|
@bugbuilder thanks, but ideally standard addons should be part of the |
Yep, but in the meantime I need something to start working with Kind. #253 |
@hjacobs thanks for your manifest |
Hello, thank you for your manifest! Does anyone know if is it possible to create a ServiceMonitor to have the metrics from
|
HPA tests require the metrics server and are now in conformance, I want to see if kubeadm should be shipping this by default but one way or another kind needs to ship the metrics APIs :-) |
@BenTheElder |
@neolit123 why? We need metrics APIs to run Kubernetes tests at parity with the existing test setups, and it seems these are commonly available / depended on. |
Note: we do not aim for mere conformance, but conformance is definitely the minimum bar. |
definitely out of scope for kubeadm. a metrics system is not a essential dependency.
can you show examples?
latest comments suggest that this will be revised, possibly metrics tests will be skiped if no metrics system is present. i think that creating a mock metrics system in the framework is better but someone needs the bandwidth to work on that. |
Conformance OR reasonable testing / user usage, including HPA / dashboard / ...
The test that was promoted to conformance was already one of the default presubmit tests for Kubernetes (see also #701), eventually we should be able to run ~all of these (relatively trivial things block this currently, such as node exec mechanisms, we're working on it).
That means we test less. A) currently skipping is banned in conformance and B) we don't want to do less testing with kind because we can't be bothered to configure something that enables a default-enabled v1 core API to function. We only want to skip tests that we can't technically accomplish. I gather some people think this should not be a core API, but it already is and v1 / default available at this point so that seems like a moot argument.
Metrics can't be in the framework as it's HPA reading them? I don't think we should HPA with fake metrics. |
Just leaving this here since I (and anyone else who might be using Ansible with KinD to deploy metrics-server) will probably find it in search results again at some point: To add the two required options to the official metrics-server manifest prior to deploying it into the cluster, here's a few Ansible tasks you can use. Hacky but I like to rely on the official upstream manifest for my testing: ---
- name: Download metrics-server manifest.
get_url:
url: https://github.com/kubernetes-sigs/metrics-server/releases/download/{{ metrics_server_version }}/components.yaml
dest: /tmp/metrics-server.yaml
mode: 0644
- name: Modify the manifest to allow insecure TLS for testing.
lineinfile:
path: /tmp/metrics-server.yaml
state: present
regexp: "^.+{{ item }}$"
line: " - --{{ item }}"
insertafter: "^.+args:$"
with_items:
- kubelet-preferred-address-types=InternalIP
- kubelet-insecure-tls
- name: Deploy metrics-server into the cluster.
community.kubernetes.k8s:
state: present
src: /tmp/metrics-server.yaml
wait: true |
For posterity; Here is the current solution with helm |
Circling back to this:
PVC on the other hand, is very commonly necessary, not going anywhere, but generally not difficult to deploy or part of the cloud provider, it seems understandable that kubeadm wouldn't see demand for this, but kind absolutely did (and pretty much any other cluster level tool I think). That said, I actually haven't seen that much demand yet.
To be clear: conformance nearly required that some implementation must be present. There was never an attempt to make it metrics-server specific. In fact the PR was from redhat / openshift, and IIRC they ship the prometheus adapter instead of metrics-server. AIUI kops, kubespray and most managed solutions do already provide it (though perhaps optionally). minikube has it as an "addon" built-in, but not by default. |
i don't love the insecure TLS that seems to be in use so far here, but I think we should evaluate how "heavy" this is to ship by default for those that aren't using it (memory, cpu, node image size...), and at the very least get a doc up somewhere similar to the loadbalancer guide we just added. |
If you want to use metrics-server 0.5, the default chart registry is not updated anymore. Here is the latest config that works (I'm using Terraform to deploy it): resource "helm_release" "metrics-server" {
name = "metrics-server"
namespace = "kube-system"
repository = "https://charts.bitnami.com/bitnami"
chart = "metrics-server"
version = "5.8.11"
set {
name = "extraArgs.kubelet-insecure-tls"
value = true
}
set {
name = "extraArgs.kubelet-preferred-address-types"
value = "InternalIP"
}
set {
name = "apiService.create"
value = true
}
} |
If someone blindly uses above patch argument it may not work with latest metric-server release. |
This allows one to use `k top pods` and lets the vpa recommender calculate recommendations. See kubernetes-sigs/kind#398 Co-authored-by: Wesley Bermbach <wesley.bermbach@sap.com> Co-authored-by: Istvan Zoltan Ballok <istvan.zoltan.ballok@sap.com> Co-authored-by: Jeremy Rickards <jeremy.rickards@sap.com>
This allows one to use `k top pods` and lets the vpa recommender calculate recommendations. See kubernetes-sigs/kind#398 Co-authored-by: Wesley Bermbach <wesley.bermbach@sap.com> Co-authored-by: Istvan Zoltan Ballok <istvan.zoltan.ballok@sap.com> Co-authored-by: Jeremy Rickards <jeremy.rickards@sap.com>
This allows one to use `k top pods` and lets the vpa recommender calculate recommendations. See kubernetes-sigs/kind#398 Co-authored-by: Wesley Bermbach <wesley.bermbach@sap.com> Co-authored-by: Istvan Zoltan Ballok <istvan.zoltan.ballok@sap.com> Co-authored-by: Jeremy Rickards <jeremy.rickards@sap.com>
This allows one to use `k top pods` and lets the vpa recommender calculate recommendations. See kubernetes-sigs/kind#398 Co-authored-by: Wesley Bermbach <wesley.bermbach@sap.com> Co-authored-by: Istvan Zoltan Ballok <istvan.zoltan.ballok@sap.com> Co-authored-by: Jeremy Rickards <jeremy.rickards@sap.com> Co-authored-by: Wesley Bermbach <wesley.bermbach@sap.com> Co-authored-by: Jeremy Rickards <jeremy.rickards@sap.com>
Until this is official, here is how I installed it today using helm cli:
This installs the latest version of the chart/app from https://artifacthub.io/packages/helm/metrics-server/metrics-server |
Any updates on this? |
If there were, they'd be posted here to this tracking issue 🙃 This is an optional addition (these metrics are not part of conformance), and possible to install after creating the cluster. The current approach is not something we want to bake in by default. It will make the node images larger and is generally non-essential. The most recent suggested approach #398 (comment) looks straightforward to run after |
Hi hjaco, Did not work for me.
|
I've installed it successfully, but still i don't see any metrics in Lens. Do i have to configure something else? |
If |
you're right. The |
Do we still need this? I agree, I don't think we want it included by default. The only action item I saw was potentially adding docs for adding it after cluster creation. But there has also been recent discussion about removing Ingress docs since it's not really within the scope, or resources, of the kind team to maintain docs for external projects. Unless there's something very unique and kind-specific, I'd think it would be better to leave it out. I might be jumping the gun, but I'm going to close this. If one of the maintainers thinks there is something to be done in kind itself for this, please reopen. /close |
@stmcginnis: Closing this issue. In response to this:
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-sigs/prow repository. |
#3625 (comment) I suppose. |
The metrics-server should be installed out of the box to enable
kubectl top ..
and tools like kube-ops-view. I tried to install the metrics-server, but it did not work for me, it just logs errors like:The text was updated successfully, but these errors were encountered: