Kubernetes has become the go-to solution for managing containerized applications in production environments. Many developers are now moving away from traditional cluster management, as it can be time-consuming and complex. Amazon Elastic Kubernetes Service (EKS) simplifies the process of deploying Kubernetes clusters in the cloud, making it an attractive choice for developers.
Naresh I Technologies, the leading computer training institute in Hyderabad and one of the top five computer training institutes in India, offers comprehensive AWS training, covering all AWS certifications. Contact us today for professional AWS training.
Containers have been in use since the advent of Linux, with Docker emerging as a modern containerization solution. Kubernetes enables efficient deployment and management of containerized applications at scale, ensuring portability and extensibility. However, deploying a Kubernetes cluster manually can be time-intensive due to the need for configuring master-worker nodes. Amazon EKS provides a streamlined solution to this challenge.
Managed Kubernetes Service: Amazon EKS eliminates the need to manage the Kubernetes control plane, handling provisioning, patching, and upgrades.
Highly Available: It operates across multiple availability zones, ensuring resilience and reliability.
Secure Communication: Encrypted communication between worker nodes and the Kubernetes endpoint enhances security.
Kubernetes Compatibility: Applications running on EKS are fully compatible with other Kubernetes environments.
AWS Integration: Amazon EKS works seamlessly with AWS services and supports native Kubernetes functionalities.
Deploying an application with Amazon EKS is straightforward. Follow these steps to set up an EKS cluster:
Create an EKS cluster via the AWS Management Console, CLI, or SDKs.
Deploy worker nodes and integrate them into the EKS cluster.
Use Kubernetes tools to interact with the cluster.
Deploy and manage applications just as you would in any Kubernetes environment.
Now, let’s explore how to deploy a containerized application in a Kubernetes cluster using EKS.
In this guide, we will deploy an Nginx application on a Kubernetes cluster using EKS. Follow these steps:
Ensure you have the following:
An AWS IAM account with proper permissions.
The latest version of AWS CLI installed.
AWS IAM authenticator and Kubectl configured.
Create an IAM Role:
Go to the IAM console.
Navigate to "Roles" and click "Create Role."
Select "AWS Service" and choose "EKS."
Name the role and click "Create Role."
Create a VPC for EKS Deployment:
Open AWS CloudFormation.
Click "Create Stack."
Choose "Specify an Amazon S3 template URL."
Review and confirm the details, then create the VPC.
Open the EKS console and click "Create Cluster."
Provide necessary details, including cluster name, VPC, subnets, security groups, and IAM role.
Click "Create" to launch the cluster.
Install Kubectl and the AWS IAM Authenticator.
Set up a kubeconfig file for your cluster:
aws eks update-kubeconfig --region your-region --name your-cluster-name
Verify the configuration:
kubectl get svc
Wait for the cluster status to become "Active."
Open AWS CloudFormation and create a stack with the necessary worker node configurations.
Retrieve the worker node Role ARN from the stack outputs.
Create an aws-auth YAML file to allow worker nodes to join the cluster:
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: "arn:aws:iam::your-account-id:role/your-node-instance-role"
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
Apply the configuration:
kubectl apply -f aws-auth.yaml
Check node status:
kubectl get nodes
Create a Kubernetes Deployment YAML file (nginx-deployment.yaml
):
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
Apply the deployment:
kubectl apply -f nginx-deployment.yaml
Expose the deployment with a service:
kubectl expose deployment nginx-deployment --type=LoadBalancer --port=80
Retrieve the external IP:
kubectl get svc
Open the IP address in a web browser to view the running Nginx application.
After completing the deployment, clean up resources to avoid unnecessary charges:
kubectl delete service nginx-deployment
kubectl delete deployment nginx-deployment
aws eks delete-cluster --name your-cluster-name
.jpg)
Congratulations! You have successfully deployed a containerized application on a Kubernetes cluster using Amazon EKS.
Naresh I Technologies is a premier computer training institute in Hyderabad and among the top five in India. We offer in-depth AWS training, covering all certifications. Choose from online or classroom training based on your convenience. We also provide corporate on-premises training and world-class lab facilities. Freshers can benefit from our job placement assistance.
For AWS training inquiries, call us or fill out our online contact form. Our counselors are available to guide you. Start your AWS journey with us today!
Course :