Skip to content

Instantly share code, notes, and snippets.

@NileshGule
Last active June 21, 2024 16:37
Show Gist options
  • Save NileshGule/8f772cf04ea6ae9c76d3f3e9186165c2 to your computer and use it in GitHub Desktop.
Save NileshGule/8f772cf04ea6ae9c76d3f3e9186165c2 to your computer and use it in GitHub Desktop.
gist to update kuberentes metrics server deployment

deploy metrics server


kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

edit metrics server deployment by adding command


k -n kube-system edit deploy metrics-server

containers:
- args:
- --cert-dir=/tmp
- --secure-port=4443
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --kubelet-use-node-status-port
- --metric-resolution=15s
command:
- /metrics-server
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP
@WasimAhmad
Copy link

WasimAhmad commented Oct 21, 2022

download yaml file and add command session then apply
- args:
- --cert-dir=/tmp
- --secure-port=4443
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --kubelet-use-node-status-port
- --metric-resolution=15s
command:
- /metrics-server
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP

@bb-vikrantshetty
Copy link

@NileshGule I am still getting the same error
Readiness probe failed: HTTP probe failed with statuscode: 500

@bobymark
Copy link

Use this link to resolve https://stackoverflow.com/questions/71843068/metrics-server-is-currently-unable-to-handle-the-request
kubectl edit deployments.apps -n kube-system metrics-server
Resolved by editing the deployment yaml files and adding the hostNetwork: true after the dnsPolicy: ClusterFirst
save the file and wait for a min and then check the kubectl top no

@Thachana
Copy link

you made it .

Copy link

ghost commented Aug 29, 2023

everything worked perfectly but when I proceeded with kubectl top nodes it showed the error: Metrics API not available
Normal Created 3m28s kubelet Created container metrics-server
Normal Started 3m28s kubelet Started container metrics-server
@NileshGule @WasimAhmad

@ToneCode
Copy link

Awesome, it works for me!

@Asfawh
Copy link

Asfawh commented Oct 28, 2023

Thank you for these!

@henrique-alexandre
Copy link

Thank you very VERY much for this!

@theten52
Copy link

Thanks so much for this! it works for me!

@irtazakhalid24
Copy link

Hi, Can someone let me know the location of this file kubernetes-metrics-server.yaml

@tbernacchi
Copy link

@tbernacchi
Copy link

@NileshGule I've follow the exactly steps provided and I still got no lucky. Any ideas?

@tbernacchi
Copy link

same for me @ghost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment