Setup Kubernetes CLI for EKS
Prerequisites
Install Kubernetes CLI tool - kubectl. Instructions can be found here: https://kubernetes.io/docs/tasks/tools/install-kubectl/
Install the AWS CLI. https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
Create AWS SSO profile
Run command and apply settings as below: aws configure sso
SSO session name (Recommended): cloudservice SSO start URL [None]: https://iqx.awsapps.com/start# SSO region [None]: ap-southeast-2 SSO registration scopes [None]: sso:account:access
The CLI will open a page in browser for authentication. Follow the page and Allow CLI access your account.
Select the account “cloudservice@iqxbusiness.com” from account list.
Select a role according to your need.
Apply following for the rest of configurations.
CLI default client Region [None]: ap-southeast-2 CLI default output format [None]: json
Connect kubectl to EKS cluster
Create EKS context. Run the command below. You don’t need to run this command again once the context is created.
aws eks update-kubeconfig --region ap-southeast-2 --name <your cluster name> --profile cloudservice
Get all kubectl contexts available.
Select the context for the cluster that you want to work on.
Test the connection.