SSO is used for Programatic access and to login to AWS console.
Open URL for SSO [https://domain.awsapps.com/start].
Use your SSO [username] and [password] to sign in.
Click on Management console to open AWS console or click on Command line or programmatic access for programmatic access.
After clicking on Command line or programmatic access use temporary keys by clicking on Click to copy these commands and paste the credentials in terminal.
Another option is to use aws-vault with SSO.
Install aws-vault.
vim .aws/config
Paste the SSO config in the file:
[profile example-dev] sso_start_url=https://example.awsapps.com/start sso_region=us-west-1 sso_account_id=987654321 sso_role_name=AdministratorAccess region=us-west-1
Use aws-vault exec command to exec to AWS account. For example, to exec to example-dev use aws-vault exec example-dev . This command redirects to web and waits for you to login to SSO and allow the request.
After both options you will be able to exec to EKS cluster.
aws eks update-kubeconfig --name [cluster-name] --region [region-name]
Use this command to get all pods from all namespaces:
kubectl get pods -AUse this command to exec to one of pods:
kubectl exec -it pod/[pod-name] /bin/bash