Deployment of Wordpress & MySql on the top of K8S Cluster through AMAZON EKS Service
Rahul Kumar
DevOps Engineer || 3x GCP Certified || DevOps || Docker || kubernetes || OpenShift || Ansible || Jenkins || AWS || Terraform || Immediate joiner
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 :
After this i will install ekctl and create cluster
I have create a cluster using YAML file
here is the file:
It takes almost 30 minutes to create cluster :
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.
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
we can also see our nodes:
Now we create a namespace so that everything is stored in a single plane.
kubectl create namespace at-node
I have no pods running in my namespace.
Then i created it and expose to port no 80
And after that you can see connectivity and open on your browser.
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.
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
and thw wordpress-deployment file is :
and after this we will create a secret file :
and then a customication file to lauch all the file in as single click
>kubectl create -k .
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
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
Therefore , Our Wordpress Site is ready !!
Like this we can use prometheous and grafana also .
DevOps Engineer || 3x GCP Certified || DevOps || Docker || kubernetes || OpenShift || Ansible || Jenkins || AWS || Terraform || Immediate joiner
4 å¹´Thanks bhaiya
Devops Engineer at Think Future technologies
4 å¹´keep it up