Introducing kubectl configuration
kubectl is a Kubernetes command-line management client tool that allows a user to interact with the Kubernetes API server and perform any administrative task, including deploying, updating, or deleting an application (as long as they have permission to do so).
In order to communicate with the cluster, the cluster details, such as the API endpoint DNS name and server certificates, all need to be added to the kubeconfig
file. The following command can be used (you will need to have the AWS CLI installed) to update the config file, which will normally be stored in the config
file in $HOME/.kube
:
$ aws eks update-kubeconfig --name mycluster --region eu-central-1
Important note
The AWS user that is being used to run the CLI command will need IAM permissions to the AWS EKS API to successfully perform this operation.
The file will now contain a reference to the new cluster, in the cluster
section, with the certificate data, API endpoint...