Kubectl "AccessDenied" error on EKS

On GitLab.com I enabled Kubernetes on EKS and got the Rails Template App up and running. Now I tried to configure the DB via an env var. As far as I understood, I need to run kubectl to access the config for the env vars.

When I now run something like kubectl get svc I get this error

An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:iam::123:user/xyz is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123:user/xyz
  • How can I access Kubernetes via kubectl?
  • How do I set env vars e.g. for the database credentials?

Help is very appreciated - many thanks in advance.

Cheers,
Thorsten

Found the solution here: https://medium.com/@ngocson2vn/how-to-fix-the-error-an-error-occurred-accessdenied-when-calling-the-assumerole-operation-e85f0152daca