Prerequisites
Before you begin, ensure you have the following:

-
Install the kubectl command-line tool on your device or AWS CloudShell. Its version must match your cluster's Kubernetes version or be one minor version earlier or later.
-
An IAM user or role with permission to use the eks: DescribeCluster API action for the specified cluster.
Here are the steps to Create or Update kubeconfig:

Replace <region-code> with the AWS Region of your cluster and <my-cluster> with your cluster's name.
-
The default configuration file is saved at ~/.kube/config. To use a different path, specify with --kubeconfig.
-
To use a specific IAM role for authentication, add --role-arn. If not specified, the default AWS CLI credentials are used. Check your current identity by running this:




For more information click here.