Deployment of Wordpress & MySql on the top of K8S Cluster through AMAZON EKS Service

Deployment of Wordpress & MySql on the top of K8S Cluster through AMAZON EKS Service

First of all What is EKS?

Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that makes it easy for you to run Kubernetes on AWS without needing to stand up or maintain your own Kubernetes control plane. Kubernetes is an open-source system for automating the deployment, scaling, and management of containerized applications.

Amazon EKS is also integrated with many AWS services to provide scalability and security for your applications, including the following:

  • Amazon ECR for container images
  • Elastic Load Balancing for load distribution
  • IAM for authentication
  • Amazon VPC for isolation

Let's start with practical:

First we have configure aws and install aws ,eksctl software :

No alt text provided for this image

After this i will install ekctl and create cluster

No alt text provided for this image
No alt text provided for this image

I have create a cluster using YAML file

here is the file:

No alt text provided for this image
No alt text provided for this image

It takes almost 30 minutes to create cluster :

No alt text provided for this image

After it is done you can go and check the CloudFormation to check all the nodegroups.And the EC2 instances to see all the instances are running.

No alt text provided for this image

Now For connecting to the master, kubectl cmd require config file (.kube) having IP , username and password.

Update config file to allow kubectl to send instructions to master node.

aws eks update-kubeconfig --name ekcluster 
No alt text provided for this image

we can also see our nodes:


Now we create a namespace so that everything is stored in a single plane.

No alt text provided for this image
kubectl create namespace at-node

I have no pods running in my namespace.

No alt text provided for this image

Then i created it and expose to port no 80

No alt text provided for this image

And after that you can see connectivity and open on your browser.

No alt text provided for this image

You can see here the load balancer is created and having internet facing.Anyone from outside world having my DNS name can connect to my webserver.

No alt text provided for this image

Now we create an EFS provisioner that allows us to mount EFS storage as PersistentVolumes in kubernetes. It consists of a container that has access to an AWS EFS resource. The container reads a configmap which contains the EFS filesystem ID, the AWS region and the name you want to use for your efs-provisioner. This name will be used later when you create a storage class.

here is the mysql-deployment.yml file

No alt text provided for this image
No alt text provided for this image

and thw wordpress-deployment file is :

No alt text provided for this image
No alt text provided for this image

and after this we will create a secret file :

and then a customication file to lauch all the file in as single click

No alt text provided for this image

>kubectl create -k .

No alt text provided for this image
No alt text provided for this image

after reating this we will get a load balancer from the ip of load balancer we can connect to our wordpress and launch our wordpress site

No alt text provided for this image

and this screen u will get

this is the screen of wordpress site .

after this you will get a login and password space where you have to write your login and password then you will reach to wordpress site:

and get a page like this

No alt text provided for this image

Therefore , Our Wordpress Site is ready !!

Like this we can use prometheous and grafana also .

Thanks for reading this post !!!



Rahul Kumar

DevOps Engineer || 3x GCP Certified || DevOps || Docker || kubernetes || OpenShift || Ansible || Jenkins || AWS || Terraform || Immediate joiner

4 å¹´

Thanks bhaiya

赞
回复
Mitesh Dhruv

Devops Engineer at Think Future technologies

4 å¹´

keep it up

赞
回复

要查看或添加评论,请登录

Rahul Kumar的更多文章

社区洞察

其他会员也浏览了