You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I deployed new EKS cluster with mastersRole, and then I connected to k8s cluster by assume masterRole, It worked perfectly fine.
Next I'm following this document to install metrics-server on my cluster. Then using kubectl top node to verify metrics-server is working correctly or not.
Unfortunately, I encountered a server error:
$ kubectl top node
error: You must be logged in to the server (Unauthorized)
In order to debug the error, I use kubectl -n kube-system logs -l k8s-app=metrics-server to print logs, the log of metrics-server is shown as below:
I1130 19:40:37.230865 1 serving.go:312] Generated self-signed cert (apiserver.local.config/certificates/apiserver.crt, apiserver.local.config/certificates/apiserver.key)
I1130 19:40:37.582772 1 secure_serving.go:116] Serving securely on [::]:443
E1130 19:41:15.309837 1 authentication.go:65] Unable to authenticate the request due to an error: x509: certificate signed by unknown authority
E1130 19:45:23.565685 1 authentication.go:65] Unable to authenticate the request due to an error: x509: certificate signed by unknown authority
After that, I created a support ticket to AWS support, and he pointed out that the aws-auth isn't set correctly, the role in mapRoles should contain username. According to AWS documentation, the default value of username should be roleArn.
To solve this problem, a workaround is adding master role manually with username:
wait for metrics-server deployed, and use kubectl top node to reproduce this problem
$ kubectl top node
Error Log
Error log of kubectl top node
error: You must be logged in to the server (Unauthorized)
Error log of metrics-server
I1130 19:40:37.230865 1 serving.go:312] Generated self-signed cert (apiserver.local.config/certificates/apiserver.crt, apiserver.local.config/certificates/apiserver.key)
I1130 19:40:37.582772 1 secure_serving.go:116] Serving securely on [::]:443
E1130 19:41:15.309837 1 authentication.go:65] Unable to authenticate the request due to an error: x509: certificate signed by unknown authority
E1130 19:45:23.565685 1 authentication.go:65] Unable to authenticate the request due to an error: x509: certificate signed by unknown authority
Environment
CLI Version : 1.8.0
Framework Version: 1.8.0
OS : macOS 10.13.6
Language : typescript
Other
Maybe I can contribute the fix I said above, to add default value of username in addMastersRole function
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered:
a60814billy
changed the title
[EKS] masterRole of aws-auth not set username cause metrics-server not working correclty
[EKS] masterRole of aws-auth is not set username cause metrics-server not working correclty
Dec 1, 2019
When mapping roles and users through the aws-auth config map, if a username is not specified, we need to default to the user/role ARN. Not specifying a default username will cause things like metrics server to fail.
Fixes#5263
* fix(eks): aws-auth username not set by default
When mapping roles and users through the aws-auth config map, if a username is not specified, we need to default to the user/role ARN. Not specifying a default username will cause things like metrics server to fail.
Fixes#5263
* chore(build): foreach.sh --up
Add support for `--up` in `foreach.sh` which will execute the command for the current module and all its dependencies (instead of the entire repo).
Use this new feature in `buildup` so from now, `buildup` is resumable. Restart can be done through `./buildup --restart`.
Update CONTRIBUTING guide.
* update expectations
iliapolo
changed the title
[EKS] masterRole of aws-auth is not set username cause metrics-server not working correclty
[aws-eks] masterRole of aws-auth is not set username cause metrics-server not working correclty
Aug 16, 2020
I deployed new EKS cluster with mastersRole, and then I connected to k8s cluster by assume masterRole, It worked perfectly fine.
Next I'm following this document to install
metrics-server
on my cluster. Then usingkubectl top node
to verify metrics-server is working correctly or not.Unfortunately, I encountered a server error:
In order to debug the error, I use
kubectl -n kube-system logs -l k8s-app=metrics-server
to print logs, the log of metrics-server is shown as below:After that, I created a support ticket to AWS support, and he pointed out that the
aws-auth
isn't set correctly, the role inmapRoles
should containusername
. According to AWS documentation, the default value ofusername
should be roleArn.To solve this problem, a workaround is adding master role manually with
username
:or modify the addMastersRole function in AwsAuth class, adding default username when username is not set.
aws-cdk/packages/@aws-cdk/aws-eks/lib/aws-auth.ts
Lines 59 to 64 in 1dcba75
Because the constructor of Cluster is not sent username to addMasterRole function
aws-cdk/packages/@aws-cdk/aws-eks/lib/cluster.ts
Line 412 in 1dcba75
Reproduction Steps
kubectl top node
to reproduce this problemError Log
kubectl top node
metrics-server
Environment
Other
Maybe I can contribute the fix I said above, to add default value of
username
in addMastersRole functionThis is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: