Unable to grant additional AWS roles the ability to interact with my cluster
You will want one of 3 things; either:
- assume the
arn:aws:iam::123456789012:role/myAmazonEKSClusterRole
in a terminal session such that theaws eks get-token
run bykubectl
will behave correctly - create an awscli profile that assumes the
arn:aws:iam::123456789012:role/myAmazonEKSClusterRole
role and update theargs:
to include[..., "--profile", "whatever-you-call-that-profile",...]
- or assume the role in a terminal, run
aws eks get-token
, and put that static credential in your kubeconfig since it doesn't seem you need the credential for very long just to update that ConfigMap
For the first one, I mean aws sts assume-role --role-arn arn:aws:iam::123456789012:role/myAmazonEKSClusterRole ... | tee sts-creds.json
and then export AWS_ACCESS_KEY_ID= AWS_SECRET_KEY= AWS_SESSION_TOKEN=
based on the contents of that json
For the second one, I mean:
$ cat >> $HOME/.aws/config <<FOO
[profile my-cluster]
assume_role = arn:aws:iam::123456789012:role/myAmazonEKSClusterRole
source_profile = whatever
; or credential_source = whatever
FOO
according to this documentation