Launching A WordPress Application With MySql Database On K8s Cluster Over AWS☁️ Using Ansible !!
Hello Friends !!
I am again back with one more interesting use case which help you to learn more about the Ansible, K8s and AWS !
This article help you to Launch the WordPress application with MySQL database on K8s_cluster over AWS using Devops automation tool Ansible.
As I have already automate the K8s_Multinode Cluster on AWS by using Ansible. In this Article We will see how to launch the WordPress application with MySQL Database on K8s_Multinode cluster By using Ansible
Refer above link to know how to configure the k8s_Multinode Cluster on AWS by using Ansible.
For further configuration I have use the ANSIBLE ROLE.
⭐Steps required to Launch the WordPress application with MySQL Database.
Create the Ansible roles .
Command : ansible-galaxy init <role_name>
Check the connectivity between the Managed node and Target node
Now Write the tasks and variables in the respective files of ansible roles
First, Create the workspace to copy the yaml file which help to launch the pods and service
Create the different yaml files which contain code for launching the MySQL pod , WordPress pod and Service to expose the WordPress pod respectively. Copy this files into the created workspace
Put WordPress and service files into the files folder as they are not using variables but to launch the MySQL pod we need variables so put that file into templates folder of ansible role
Now Run the files by using shell module to run the pods and service
After launching the pods it takes time to launch so, pause the playbook for 60 seconds so all the pods will be ready and we can get the complete information of the pods
Create main playbook to launch WordPress and MySQL on K8S Cluster over AWS ☁️
Let’s run the playbook and check whether it will work or not
Command : ansible-playbook <file_name>.yml
From above you can see that the playbook run successfully, pods and service launches successfully.
Let’s see the browser output
Yes ! we solve the use case successfully !!!
Thank You for Reading🤩 !!