-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to fetch pod metrics & request failed - "401 Unauthorized" #212
Comments
Metrics server may fail to authenticate if kubelet is running with
This might break authorization for kubelet-api user if
|
@mabushey I believe using "args" is slightly better than "command", it respects the entrypoint.
|
@githubcdr |
I have created metric server with below deployment and addedd kubelet config in kops but I still get 401
Logs:
|
Does metrics-server service account have access to "nodes/stats" resource? |
It works now. I am not sure what caused it to work.
|
@zahid0 I'm still facing the issue, I tried to edit cluster and update the metric yaml file. Below are my changes:
@rajeshkodali I also ran your command, I don't think it works
|
I'm facing the same problems as @vinhnglx despite making all the fixes mentioned on this issue. :( |
guys, any idea? I spent a few hours today but still can't make it works. |
Here is my working config:
Metrics server yaml:
role.yaml from kubernetes/kops#5706 and
|
thanks @rajeshkodali . I still hit the error "401 Unauthorized"
|
What's the output of kubectl --v=10 top nodes ?
…On Wed, Feb 13, 2019 at 7:19 PM Vincent Nguyen ***@***.***> wrote:
thanks @rajeshkodali <https://github.com/rajeshkodali> .
I still hit the error "401 Unauthorized"
E0214 03:16:54.413600 1 manager.go:102] unable to fully collect metrics: [unable to fully scrape metrics from source kubelet_summary:ip-10-10-2-189.ap-southeast-1.compute.internal: unable to fetch metrics from Kubelet ip-10-10-2-189.ap-southeast-1.compute.internal (10.10.2.189): request failed - "401 Unauthorized", response: "Unauthorized", unable to fully scrape metrics from source kubelet_summary:ip-10-10-1-140.ap-southeast-1.compute.internal: unable to fetch metrics from Kubelet ip-10-10-1-140.ap-southeast-1.compute.internal (10.10.1.140): request failed - "401 Unauthorized", response: "Unauthorized", unable to fully scrape metrics from source kubelet_summary:ip-10-10-1-124.ap-southeast-1.compute.internal: unable to fetch metrics from Kubelet ip-10-10-1-124.ap-southeast-1.compute.internal (10.10.1.124): request failed - "401 Unauthorized", response: "Unauthorized"]
E0214 03:17:03.349620 1 reststorage.go:144] unable to fetch pod metrics for pod default/backend-14-feb-2019-10-20-15-5bb5b77bcc-stb4t: no metrics known for pod
E0214 03:17:17.633193 1 reststorage.go:144] unable to fetch pod metrics for pod default/frontend-14-feb-2019-10-20-04-5d5c4678bc-k7vpv: no metrics known for pod
E0214 03:17:33.357307 1 reststorage.go:144] unable to fetch pod metrics for pod default/backend-14-feb-2019-10-20-15-5bb5b77bcc-stb4t: no metrics known for pod
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#212 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATHASXG-YIiioGZZ0xwSCZRb9ai2nUfqks5vNNWogaJpZM4aXFVd>
.
--
*Rajesh Kodali*
*Sr. DevOps Engineer*
|
The output when running that command:
|
@vinhnglx could you check the arguments passed to |
@zahid0 I'm using Kops to install Kubernetes with vpc, private subnets, and calico CNI for networking. I'm not able to ssh to the instance to check the kubelet. But I already set the
And it still shows the |
@vinhnglx do you mind showing the output of |
@zahid0 I don't mind, but I'm using kops with terraform output. My steps are:
|
@vinhnglx |
@zahid0 Oh, no. My script has a mistake, should run kops rolling-update but I ran kops update. Now it works. I can get the metrics. Thanks a lot for your help :)
|
I changed from using "args" to "commands" and I don't see the
|
@zahid0, how to add the kubelet config when I am using eksctl to create the cluster on AWS EKS? |
@serathius Thanks for pointing out node/stats in https://github.com/serathius/kubernetes/blob/53b13b66645923e231e8f7950932c61f02f1c276/cluster/addons/metrics-server/resource-reader.yaml#L14 This should be PR back to upstream. |
I experience the same as @khteh above. I have set the following kubelet arguments:
The The metrics-server logs:
I am using AWS EKS with Kubernetes 1.12 and installed the metric-server from helm (https://github.com/helm/charts/tree/master/stable/metrics-server):
The pod is deployed with a HorizontalPodAutoscaler:
Still no percentages:
Any idea why the |
The kubectl top nodes show valid data with resource percentage. kubectl top pods does not have any percentage, but shows values.
|
Deployment , Replicaset yaml ### spec: yaml write have to |
This configuration worked me too. It took a lot of time to completely rollout for my cluster. |
I got it working. Thanks, Team. |
should we aggregate all of these setup problems into one ticket? e.g. #278 |
@zoltan-fedor @zhanghan12 My setup is kops 1.13 with k8s 1.13.5 & istio I have setup similar to other comments:
And running metrics-server as:
What really helped me is able to debug the issue by setting the log level.. And i found this article by rancher
Following the guide and creating the additional ClusterRole binding for |
@zahid0 Thank you so much, you saved my day |
this works thank you very much. saved some prod time :) #212 (comment) |
hi, what is the solution for that atm? and why does the error show at all? |
a upgrade from kubernetes 1.15.0 to 1.15.6 helped and fixed the issue |
@serathius is this fixed? |
Closing per Kubernetes issue triage policy GitHub is not the right place for support requests. |
@zahid0 response above worked for me.
Was a little confused about the ClusterRoleBinding, but eventually discovered it was already setup in my Kops deployment within the kube-system namespace.
Went back-n-forth a few times on the WebHook settiing to be sure; i.e., Also applied @samuel-elliott hostNetwork: true recommendation. |
This work nice for me on v1.26.9+k0s. |
Added "fixes" which reduces the errors:
git diff deploy/1.8+/metrics-server-deployment.yaml
kubectl -n kube-system logs -f metrics-server-68df9fbc9f-fsvgn
Is there a version that works (ie one of the 200 forks)?
I've used k8s 1.10 and 1.11 on AWS via Kops.
The text was updated successfully, but these errors were encountered: