1. Install Prerequisites
Install the AWS CLI to manage AWS services.Install kubectl to run commands on Kubernetes clusters.
Install eksctl as a simple command-line tool for cluster creation.
Set up an active AWS account with administrator permissions.
2. Create an IAM Role for EKS
Open the IAM console in AWS.Create a role for EKS and attach the AmazonEKSClusterPolicy permission.
This role allows EKS to manage resources on your behalf.
3. Create the EKS Cluster
Navigate to EKS in the AWS Management Console or use the command line.Run eksctl create cluster or use the console wizard to specify your cluster name, region, and Kubernetes version.
Select your Virtual Private Cloud (VPC) and subnets.
Wait roughly 10 to 15 minutes for the control plane to provision.
4. Add Worker Node Groups
Go to your newly created cluster's compute tab.Click Add node group.
Create an IAM role for nodes with policies like AmazonEKSWorkerNodePolicy, AmazonEC2ContainerRegistryReadOnly, and AmazonEKSCNIPolicy.
Pick your instance type (such as t2.medium) and define the minimum, maximum, and desired node counts.
5. Connect and Configure kubectl
aws eks update-kubeconfig --region <region-code> --name <cluster-name>
Verify the connection by running kubectl get nodes to see your active worker instances.
6. Deploy Your Application
Create a deployment configuration file in YAML format.
Apply the configuration to the cluster using dev.to Application Guide command:
kubectl apply -f deployment.yaml
Expose your deployment as a service to access the running container.
