Reputation: 357
I ran the following command to install the metrics server on the AWS EKS Fargate so that I can implement HPA on the AWS EKS Fragate pods (used this aws doc https://docs.aws.amazon.com/eks/latest/userguide/metrics-server.html for downloading metric-server)
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
But when checking the status of the metric-server created, I get the following error.
"E0124 20:06:19.813199 1 scraper.go:149] "Failed to scrape node" err="Get "https://10.0.138.91:10250/metrics/resource": tls: failed to verify certificate: x509: certificate is valid for 127.0.0.1, not 10.0.138.91" node="fargate-ip-10-0-138-91.ec2.internal"
And also I am not able to get the output of these commands.
Kubectl top pods -A
Its sows the error "Error from server (ServiceUnavailable): the server is currently unable to handle the request (get pods.metrics.k8s.io)
"
Upvotes: 0
Views: 533
Reputation: 1
If you are using Fargate, you will need to change the components.yaml In the default configuration, the metrics server uses port 10250. This port is reserved on Fargate. Replace references to port 10250 in components.yaml with another port, such as 10251.
https://docs.aws.amazon.com/eks/latest/userguide/metrics-server.html
Download the components.yaml file:
wget https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
sed -i 's/10250/10251/g' components.yaml
kubectl apply -f components.yaml
Upvotes: 0