-
Notifications
You must be signed in to change notification settings - Fork 423
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
error: the server doesn't have a resource type "svc" #157
Comments
I was experiencing this until I opened a new tab in Terminal |
We are also seeing this exact problem. This is the output we get:
We additionally assumed the role we created for our EKS cluster using
We too can seemingly successfully use the aws-iam-authenticator
...And opening a new tab did not work :( Cheers, |
@laszlocsontos Whichever user/role's credentials you were using when you created the EKS cluster are the credentials you should be using when you try |
@Samze it appears that your AWS credentials are not accessible to the authenticator binary. What happens when you run |
I am facing the exact same issue |
I'm facing the exact same problem as well. Interestingly enough, the token generation works but the verify fails: aws-iam-authenticator verify -i test -t "k8s-aws-v1.aMGI3YjY0M2M0YjE1Njk5" kubectl get svc --v=10 I1111 18:27:30.124663 58459 round_trippers.go:386] curl -k -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.11.3 (darwin/amd64) kubernetes/a452946" 'https://63817EFA98124CC7D863C5AA77B202C1.sk1.us-west-2.eks.amazonaws.com/api?timeout=32s' I1111 18:27:30.961638 58459 round_trippers.go:405] GET https://63817EFA98124CC7D863C5AA77B202C1.sk1.us-west-2.eks.amazonaws.com/api?timeout=32s 401 Unauthorized in 836 millisecondsThen I try to run the kubectl curl directly that just failed making no changes and voila it works: curl -k -v -XGET -H "Accept: application/json, /" -H "User-Agent: kubectl/v1.11.3 (darwin/amd64) kubernetes/a452946" 'https://63817EFA98124CC7D863C5AA77B202C1.sk1.us-west-2.eks.amazonaws.com/api?timeout=32s'
< HTTP/1.1 200 OK
|
I was having the same issue. Doc is bit misleading, make sure your aws cli is configured with the key and secret from the user which created EKS cluster |
narup, yes, you might be on to something. I created the cluster from the GUI using SSO credentials which would have used temporary access/secret keys. All the kubectl work was done using my permanent access/secret key pair. I will have to go back and validate this again using only the CLI with my access/secret. |
Also seeing this. I created two clusters, one in the console and one from the CLI. The result is the same error. I can fetch and verify my token is my SAML user, which I used to create both clusters. I'm using 'assume-role' command to align the caller with the MFA token. ~> aws --version ~> kubectl version --short --client |
Might you guys be using Terraform at all? I know it's still just an API call for both. I'm seeing this when using Terraform that assumes a role, and regardless of if I assume that role or not, I can't access the control plane. |
Negative, I'm not using Terraform for this only the Console and the CLI. |
My problem was related to not having my IAM user keys set as default at |
I'm having the exact same issue. Kubectl logs say
I created my cluster via the AWS console using one user, and I have another user (programmatic only) for the command line. The programmatic user has full EKS permissions on that cluster.
This outputs my programmatic user correctly. However:
|
I had the same issue. Then I've found that you can connect to the kubectl cluster with the same user that created it from the console. So after creating the kube cluster with the same user that is in my aws creds, running
|
EKS is a suicide mission by AWS. This Elastic Kube Shit is not working.
All so tried using a readily available EKS-cli docker images, but same error. Tried curl as well:
Try 2:
Tried old version:
|
@jaydipdave Who are you at the CLI when getting your token (i.e. |
From AWS Docs: https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html When an Amazon EKS cluster is created, the IAM entity (user or role) that creates the cluster is added to the Kubernetes RBAC authorization table as the administrator (with system:master permissions. Initially, only that IAM user can make calls to the Kubernetes API server using kubectl. For more information, see Managing Users or IAM Roles for your Cluster. Also, the AWS IAM Authenticator for Kubernetes uses the AWS SDK for Go to authenticate against your Amazon EKS cluster. If you use the console to create the cluster, you must ensure that the same IAM user credentials are in the AWS SDK credential chain when you are running kubectl commands on your cluster. |
Hi @mrichman , Thanks for you quick response. I am using a different user at AWS CLI. i.e. "tools".
And in the role, who created the EKS cluster, I set the Trusted Entities.
I am assuming the role using "-r arn:aws:iam::xxxxxxxxxxxxx:role/EKS-manager ". Should this be sufficient? |
This really should be sufficient, but I don't think it is, and I think it's the problem that we're running into. Using an assumed role hasn't worked for me at all when creating a cluster, I've tried this a bunch of different ways. The only way I can do it is by using a logged in user (which uses an assumed role through SAML auth) Maybe we're all doing something wrong, but I haven't been able to figure it out. And a little off topic, adding other users/roles at creation is a huge oversight by AWS, if one is added at creation, I can't see why they woudn't have thought to give us the ability to add more.
Maybe the issue is coming from multiple assumed roles. Using SAML, I'm authenticating using 2FA, which assumes a role. That role that I assume then assumes another role, my Terraform role. So I'm a couple IAM roles deep at this point, and maybe something wierd is happening. |
I’m here at reinvent trying to get an audience with anyone on the EKS team who can help. |
I think the nut of the problem has do to with the initial EKS cluster creation and then the following commands via kubectl. My hypothesis is that the initial EKS cluster setup is done via the console and then the subsequent provisioning via the kubeclt on the cli breaks the aws-iam-authenticator model because the initial cluster creation stores data in the master node that is hidden. I will attempt to prove this theory as soon as I get a moment. At the Reinvent conference in Vegas.
Regards
Mark Cwetna
Slalom
From: Mark Richman <[email protected]>
Reply-To: kubernetes-sigs/aws-iam-authenticator <[email protected]>
Date: Tuesday, November 27, 2018 at 11:07 PM
To: kubernetes-sigs/aws-iam-authenticator <[email protected]>
Cc: Mark Cwetna <[email protected]>, Comment <[email protected]>
Subject: Re: [kubernetes-sigs/aws-iam-authenticator] error: the server doesn't have a resource type "svc" (#157)
I’m here at reinvent trying to get an audience with anyone on the EKS team who can help.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_kubernetes-2Dsigs_aws-2Diam-2Dauthenticator_issues_157-23issuecomment-2D442331310&d=DwMFaQ&c=fa_WZs7nNMvOIDyLmzi2sMVHyyC4hN9WQl29lWJQ5Y4&r=bizeWICKQs8YNpGSnQCdAWt6454ZIJWOmCQaNqXvmH4&m=l1zjz-TjXuvbsQ5L_znEchS-Hvu1Avt3_q9pWEluPcA&s=RbaBT5AH7kY7BiYlIaOSkVV0VZzXQhsIAc56vnJ2pEY&e=>, or mute the thread<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AE5bgnAYay3H7PLHaRuN6rhMd9VqRDP-5Fks5uzig6gaJpZM4XUt7I&d=DwMFaQ&c=fa_WZs7nNMvOIDyLmzi2sMVHyyC4hN9WQl29lWJQ5Y4&r=bizeWICKQs8YNpGSnQCdAWt6454ZIJWOmCQaNqXvmH4&m=l1zjz-TjXuvbsQ5L_znEchS-Hvu1Avt3_q9pWEluPcA&s=j-dzY-VHOfS6d6-7P6YdwNx_Ezk-_YaJm4bLOPX5pIw&e=>.
|
Possible solution if you created the cluster in the UIIf you created the cluster in the UI, it's possible the AWS You'll need to first login to the AWS CLI as the
Now you can access your cluster from the AWS CLI and using kubectl! |
Getting the root user credentials is not possible for everyone. In my case, I am using centrally managed role by the organization. I have admin access but don't have root credentials. |
Are you able to get the Access Key ID and Secret Access Key for the role you were logged in as when you created the cluster? (Or have an admin role get this for you, if you don't the permissions to do this). And then put that info in |
I usually use inter-account role assumption and terraform for aws. After reading above, I decided to do a terraform destroy on my eks master. Then I used the CLI to create it manually and I planned on just doing an import into terraform later. Before I used the CLI to create the new master, I created an IAM user just for the purpose of setting up this master and managing user access. I planned on deleting this IAM user later. But even with this IAM user, I am getting the exact same problem.
|
update:https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html
adding this:
fixed my issue. So maybe on cluster creation you can just use a manually created IAM and then import it into terraform after you use this user to setup your user permissions. Then you can just delete this IAM user to keep your cloud tidy and secure. I'm trying that next. |
It works for me now. I had to set the aws credentials in another session (tab) than the one that is using kubectl. Thanks @weotch. |
im running into this exact same thing trying to deploy from circleci to an eks cluster. horrible experience. has anyone found a solution? Im stuck trying to get a prod cluster up. Its beyond frustrating... i can access if from my laptop kubectl works and i can see everything.
logging in as root is a no-go for me. not going to happen. |
I've tried about 15 times in the last 24 hours to create a cluster that I can actually access.
Is EKS just broken? |
@jpatters This has happened to me before too. You're not using Cloud9 by chance are you? Also, what's in your What's the output from |
@mrichman I am not using cloud9. However I did just get this to work by explicitly exporting aws key and secret
(I know I said I tried this in my comment above but I must not have) I do have multiple profiles in At the moment, it seems to me like It was working on a test cluster just now. I am now launching my intended cluster via terraform and I will report back what I find. |
The only way it is working for me is if I explicitly export the credentials. It seems to be caused by the authenticator not reading |
Yes. second it. It works only if I explicitly export the credentials. |
I spoke to a gentleman at the AWS EKS booth at Kubecon. I explained this problem and how I typically use credentials that are temporary from STS due to MFA and role assumption. He said they are getting a lot of complaints on this problem and that they are trying to come up with a good solution. I shared that what I had done was to make an IAM user in that specific account for the purpose of account creation and that I intended to delete the user after I setup permissions the way I needed on RBAC. He said that is a good solution except to not delete the account but to keep it as a break-glass account in case problems arose. He also mentioned they may be working on a solution to expose master logs to you so you can see and troubleshoot without as much guessing. |
Are there any other workarounds/fixes for this? I tried explicitly exporting
and that failed on cluster create too. The error I'm getting is This only happens when using the role I created as part of the EKS Getting Started guide, any commands made without the role (by my own user account which is same as the account that created the cluster) work correctly with no problems. |
Is this a problem with |
I followed https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html
|
Like many others here, we use STS and assumed roles with profiles to access our AWS account(s). We encountered the same problem(s) that others here have. Thanks to @GeoffMillerAZ, I was able to get this working by doing the following:
After this, I was able to run `kubectl get svc':
This is mostly documented here: https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html. I would have to agree with others that the documentation (especially the "Getting Started" documentation) is not clear. Using STS with assumed roles is a very common pattern for many customers, and this should be addressed more eloquently. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Thanks for the investigation. Do I understand that this is a problem with EKS and not with BKPR? |
Oh, and BTW, another alternative that I believe can work is exporting the environment variable AWS_PROFILE instead of using the |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
We had the same issue with EKS cluster. We use Jenkins to deploy. After many errors and tries, we verify the token with the following command We check the env variables. It appears that the following environment variables are set: So, the AWS profile was good, but it used env variables to generate the token. By unsetting this env variables the token is well generated and we can now request the EKS cluster |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I could not solve this issue by creating a cluster on AWS EKS GUI. I tried eksctl to create cluster and it worked. |
Steps taken
Note: the original IAM user we had in
.aws/credentials
used AmazonEC2ReadOnlyAccess.I added that in order not to break existing scripts.
Installed aws-iam-authenticator
Generated kubeconfig
Debugging
Could you please help me in finding out what's wrong?
Thanks,
László
The text was updated successfully, but these errors were encountered: