In this post lets explore the steps involved in setting up the AWS EKS in our local workstation
AWS EKS
AWS EKS is a managed Kubernetes service that is offered by AWS to run Kubernetes clusters. Through EKS, teams can run Kubernetes clusters without the overhead of installing and operating them.
Just with the selection of node (EC2 instances) capacities for the cluster, teams get a fully functional Kubernetes cluster, ready to run your micro-service application containers as Pods 🙂
Good to know..!!
AWS EKS runs Kubernetes control plane instances across multiple Availability Zones to ensure high availability. Amazon EKS automatically detects and replaces unhealthy control plane instances, and it provides automated version upgrades and patching for them
Time needed:Â 15 minutes.
Installation steps
- Check for AWS CLI
Check if you already have AWS CLI installed in your system
aws -version - Repository
It’s better to avoid apt, pip or other repositories since they are not updated regularly to the latest version.
- Install AWS CLI
Curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- Configure your AWS CLI credentials
The AWS CLI requires that you have AWS credentials configured in your environment. The AWS configure command is the fastest way to set up your AWS CLI installation for general use.
aws configure
The execution of the above command, will prompt for four pieces of information:
access key, secret access key, AWS Region, and output format.
This information will be stored in the user profile.
AWS Access Key ID [None]: XXXXXXXXXXXXXX |
- Install Kubectl
Kubectl is the command line tool through which you interact with any Kubernetes cluster. It connects and communicates with the API server of the Kubernetes Cluster.
kubectl is available as a snap application. The following command will install it and validate if it is installed properly .
snap install kubectl --classic |
- kubeconfig
The Kubectl tool uses the kubeconfig files to choose the Kubernetes cluster to which it needs to connect and communicate.
You will need to get the region-code and cluster_name before going into this step.
From the previous steps, AWS CLI by default, through the AWS IAM Authenticator for Kubernetes will use the same credentials that are returned with the following command.
aws sts get-caller-identity |
Use the AWS CLI update-kubeconfig command to create or update your kubeconfig for your cluster.
It will create a configuration file in your system.
aws eks --region XXXXXX update-kubeconfig --name XXXXXXX |
In AWS dashboard we will get region and namespace for EKS configuration provided that in above command.
To validate the configuration we can use the svc command Service (to get all the k8s services running on the cluster)
kubectl get svc |