
This assumes you have downloaded and installed the eksctl CLI. If not, check out my article download the eksctl CLI.
Both the AWS CLI and the eksctl CLI can be used to list your Elastic Kubernetes Service (EKS) Clusters.
- aws eks list-clusters
- eksctl get clusters (this article)
The eksctl get clusters command can be used to list your Elastic Kubernetes Service (EKS) Clusters.
~]$ eksctl get clusters
NAME REGION EKSCTL CREATED
my-cluster-1 us-east-1 True
my-cluster-2 us-east-1 False
This will use the default profile in your hidden AWS credentials file (e.g. /home/john.doe/.aws/credentials). For example, if your hidden AWS credentials file has the following, the default credential would be used.
~]$ cat /home/john.doe/.aws/credentials
[default]
aws_secret_access_key = ABCDEFG123456789ABCDEFG123456789ABCDEFG12
aws_access_key_id = ABCDEFG123456789ABCD
Or, the --profile flag could be used to use some other profile in your hidden AWS credentials file.
~]$ eksctl get clusters --profile johndoe
NAME REGION EKSCTL CREATED
my-cluster-1 us-east-1 True
my-cluster-2 us-east-1 False
And then the eksctl get iamidentitymapping command can be used to list the IAM Identity Mappings, which should be from the aws-auth Config Map in the EKS Cluster.
~]$ eksctl get iamidentitymapping --cluster enterprise-sbx-useast2-1 --profile AWS-sbx-admin
ARN USERNAME GROUPS ACCOUNT
arn:aws:iam::123456789012:role/my-role system:node:{{EC2PrivateDNSName}} system:bootstrappers,system:nodes
Did you find this article helpful?
If so, consider buying me a coffee over at