Automate Kubernetes Cluster Using Ansible and launching WordPress MySQL and expose WordPress pod .

Automate Kubernetes Cluster Using Ansible and launching WordPress MySQL and expose WordPress pod .

Hello guys, here I came up with a new and interesting task here I am configuring the Kubernetes master and slave using Ansible and also we were configuring the WordPress on it using Ansible on the master which we configure using Ansible.

So, let's begin

Task Description:-

?? Automate Kubernetes Cluster Using Ansible

?? Launch ec2-instances on AWS Cloud eg. for master and slave.

?? Create roles that will configure the master node and slave node separately.

?? Launch a WordPress and MySQL database connected to it in the respective slaves.

?? Expose the WordPress pod and the client is able to hit the WordPress IP with its respective port.

So let's begin with the launching of the ec2 instance


For a detailed setup of K8s Master and Slave visit the below link in which I told about the launching of Master and Slave using Ansible.



Step 1:- Launching ec2 instance using Ansible

No alt text provided for this image


Step 2:- Let's launch the K8s master and Slave using Ansible

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

now lets launch slave

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

Step 3:- Let's launch the WordPress and SQL database

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

let's run the file

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


Step 4:- let's connect to our WordPress account

Publicip of slave :port no         

In my case it is

ip of slave:31787        
No alt text provided for this image
No alt text provided for this image




No alt text provided for this image

Let's configure the things here we need to provide the database Host it is the IP of the database pod.

we get IP while running the playbook for installation of WordPress and MySQL database.

No alt text provided for this image

from here but in my case it is in creating state only so i login to the master and taken the IP from it using Kubernetes command

?kubectl get pods -o wide        
No alt text provided for this image

here we get the IP for the database so that it copy-paste the IP and that it.

No alt text provided for this image

provide the details

No alt text provided for this image

and that its. done!!

Hope you like it.

for Any Suggestions or difficulties DM me.

Thank you!!!??????


rahul Kriplani

Senior infrastructure engineer

3 年

#bestproject

回复
Amit Sharma

CKA || 1xAWS || 4xGCP || 1xAzure || 2xRedHat Certified || DevOps Engineer [???????]@Searce Inc || Freelancer || Terraform || Ansible || GitLab || Jenkins || Kubernetes || Docker || Openshift || AWS || GCP || Azure

3 年

Nice ????

回复

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

Ritesh Chaudhari的更多文章

社区洞察

其他会员也浏览了