Launching a WordPress and MySQL architecture on K8s cluster on AWS cloud via Ansible

Here are some steps we have to follow :

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

🔅 Create roles that will configure master node and slave node separately.

🔅 Launch a WordPress and MySQL database connected to it in the respectine slaves.

🔅 Expose the WordPress pod and client able hit the WordPress ip with its respective port.

What is Kubernetes ?

A Kubernetes cluster is a set of node machines for running containerized applications. If you’re running Kubernetes, you’re running a cluster.

At a minimum, a cluster contains a control plane i.e master and one or more compute machines, or nodes. The control plane is responsible for maintaining the desired state of the cluster, such as which applications are running and which container images they use. Nodes actually run the applications and workloads. You can see the below image to see the architecture of kubernetes multinode cluster.

So, first I have created a Multi-node Kubernetes cluster on AWS Cloud via Ansible roles. Refer to this Blog K8S Multi Node Cluster over AWS Cloud.

What is WordPress ?

what is WordPress

WordPress is the simplest, most popular way to create your own website or blog.

In fact, WordPress powers over 40.0% of all the websites on the Internet. Yes more than one in four websites that you visit are likely powered by WordPress.

WordPress is a CMS (content management system)

A content management system is basically a tool that makes it easy to manage important aspects of your website like content without needing to know anything about programming.

For example, not only does WordPress power a huge number of business sites and blogs, it’s also the most popular way to create an eCommerce store as well! With WordPress, you can create:

  • Business websites
  • eCommerce stores
  • Blogs
  • Portfolios
  • Resumes
  • Forums
  • Social networks
  • Membership sites

What is MySQL ?

what is MySQL

MySQL is the most popular Open Source Relational SQL Database Management System. MySQL is one of the best RDBMS being used for developing various web-based software applications

MySQL is used by many database-driven web applications, including Drupal, Joomla, phpBB, and WordPress.

Now we would create a role to set up the Multitier setup on the Kubernetes setup.

This is our vars main file

We know that the master can set up the whole setup via kubectl command.

We will use the mysql1:5.7 image for Database setup. And wordpress:5.1.1-php7.3-apache for frontend setup.

Here we run our playbook

Now we would create a login account to WordPress and provide a site title.

We can see that we have finally launched the site on the Kubernetes cluster on AWS Cloud.

Here is the link for the above code…

Btech ECE pursuing student ....Arth Learner