K8S – Access kubernetes cluster AWS EKS

  EKS, k8s

Setup credential

[profilenamehere]
aws_access_key_id = xxx
aws_secret_access_key = xxx
[profile profilenamehere]
region = ap-southeast-1
output=json

Connect to EKS

aws sts get-caller-identity to check what aws account login on terminal now. to change profile which setting before, run export AWS_PROFILE=profilenamehere
can set profile name = default to prevent export.

export AWS_PROFILE=profilenamehere
aws eks update-kubeconfig --region ap-southeast-1 --name my-cluster

Testing

kubectl get all -A