AWS-EKS Cluster

AWS-EKS Cluster

Amazon Elastic Kubernetes Services (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. Kubernetes is open-source software that allows you to deploy and manage containerized applications at scale. Kubernetes manages clusters of Amazon EC2 compute instances and runs containers on those instances with processes for deployment, maintenance, and scaling. Using Kubernetes, you can run any type of containerized applications using the same toolset on-premises and in the cloud.

To get started with Amazon EKS:

  1. First, create an Amazon EKS cluster in the AWS Management Console or with the AWS CLI or one of the AWS SDKs.
  2. Then, launch worker nodes that register with the Amazon EKS cluster. We provide you with an AWS CloudFormation template that automatically configures your nodes.
  3. When your cluster is ready, you can configure your favourite Kubernetes tools (such as kubectl) to communicate with your cluster.
  4. Deploy and manage applications on your Amazon EKS cluster the same way that you would with any other Kubernetes environment.

To Deploy WordPress and MySQL on EKS Cluster:

Requirements:

  1. Create an IAM user with administrative power and then configure it with AWS CLI with that particular user.
  2. Install kubectl, eksctl in your system.

Now following these steps.

Step 1: Setting up the Cluster:

To setup Kubernetes cluster using amazon EKS service, we can write a yml extension code for creating a cluster with the number of instances we require right now.

After saving the yml file in a folder, we'll make the cluster by running the following command in the command prompt:

eksctl create cluster -f cluster.yml
cluster.yml file
Output of the above command

Step 2: Configuring kubectl for our EKS service

kubectl is a command-line tool which lets us control Kubernetes clusters. So to configure it for the cluster we made on AWS EC2 instances

aws eks update-kubeconfig --name d2zclusters

Step 3: Installing amazon EFS services on all the instances

yum install -y amazon-efs-utils
No alt text provided for this image

Step 4: Creating EFS-provisioner and EFS file system

First, we have to create a security group of the VPC we've created. After creating the security group, we'll create our EFS file system. After creating our EFS file system, we'll copy the DNS name and then will configure our EFS provisioner with the DNS name we copied!

No alt text provided for this image

In server, we've to copy the DNS name just like shown in this image!

This is a yaml extension file which we'll use to create our EFS provisioned. To create EFS provisioner, we've to run this command:

kubectl create -f create-efs-provisioner.yaml
No alt text provided for this image

Step 5: Creating an RBAC role

kubectl create -f create-rbac.yaml
No alt text provided for this image

Step 6: Creating Storage

kubectl create -f create-storage.yaml
No alt text provided for this image

Step 7: Creating WordPress and MySQL deploying files

Either we can deploy this here by using the similar command or we can use another concept of Kubernetes known as Kustomization.

No alt text provided for this image

This is our MySQL file.

No alt text provided for this image

This is our WordPress file.

Step 8: Creating the Kustomization file

This is the Kustomization file which helps us customize Kubernetes objects. This will run both of deploy-mysql.yaml and deploy-wordpress.yaml files in one go.

kubectl create -k .
No alt text provided for this image

Now check the pods:

No alt text provided for this image

With this, our Cluster is deployed.

No alt text provided for this image

Now test the sysre

No alt text provided for this image

So, we've finally deployed WordPress site of our own using AWS-EKS service where we learnt how to integrate EKS with EC2 and EFS services.


To view or add a comment, sign in

Others also viewed

Explore content categories