Forum breadcrumbs – You are here:Tracston Community Forum – DevOps, Micro Services, Cloud, Infrastructure, Development, Monitoring and more…DevOps / Micro Services / Automation: Kubernetes & Helm ChartsError from server (ServiceUnavail …
You need to log in to create posts and topics.
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get pods.metrics.k8s.io)
moshe@moshe
#1 · 08/12/2021, 11:10 am
Quote from moshe on 08/12/2021, 11:10 amProblem
User is trying to run the command
kubectl top pod –all-namespaces
or
kubectl top node –all-namespaces
and get the following error
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get pods.metrics.k8s.io)
Solution
first make sure metrics-server is installed
kubectl get po -n kube-system |grep metrics
if not add metrics server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlif the command ” kubectl top node –all-namespaces “ still returning error then add configuration to policykubectl edit deployment.apps -n kube-system metrics-serversearch for line with dnsPolicy: ClusterFirstand add below the linehostNetwork: true
Problem
User is trying to run the command
kubectl top pod –all-namespaces
or
kubectl top node –all-namespaces
and get the following error
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get pods.metrics.k8s.io)
Solution
first make sure metrics-server is installed
kubectl get po -n kube-system |grep metrics
if not add metrics server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
if the command ” kubectl top node –all-namespaces “ still returning error then add configuration to policy
kubectl edit deployment.apps -n kube-system metrics-server
search for line with dnsPolicy: ClusterFirst
and add below the line
hostNetwork: true
Click for thumbs down.0Click for thumbs up.0