🎑 Kubernetes Setup with WordPress using Ansible 🎑

πŸ”° What is Kubernetes ?

πŸ‘‰πŸ» Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.

πŸ”° Why you need Kubernetes and what it can do ?

Containers are a good way to bundle and run your applications. In a production environment, you need to manage the containers that run the applications and ensure that there is no downtime. For example, if a container goes down, another container needs to start. Wouldn’t it be easier if this behavior was handled by a system? That’s how Kubernetes comes to the rescue! Kubernetes provides you with a framework to run distributed systems resiliently. It takes care of scaling and failover for your application, provides deployment patterns, and more. For example, Kubernetes can easily manage a canary deployment for your system.

🎑 Kubernetes provides you with:

πŸ‘‰πŸ» Service discovery and load balancing
πŸ‘‰πŸ» Storage orchestration
πŸ‘‰πŸ» Automated rollouts and rollbacks
πŸ‘‰πŸ» Automatic bin packing
πŸ‘‰πŸ» Self-healing
πŸ‘‰πŸ» Secret and configuration management

πŸ”° What is Ansible?

Ansible is a configuration management system written in Python using a declarative markup language to describe configurations. It is used to automate software configuration and deployment.

πŸ”° MYSQL :

A relational database organizes data into one or more data tables in which data types may be related to each other; these relations help structure the data. SQL is a language programmers use to create, modify and extract data from the relational database, as well as control user access to the database. In addition to relational databases and SQL, an RDBMS like MySQL works with an operating system to implement a relational database in a computer’s storage system, manages users, allows for network access and facilitates testing database integrity and creation of backups.

πŸ”° WordPress :

WordPress is a free and open-source content management system (CMS) written in PHP and paired with a MySQL or MariaDB database.

πŸ”° Configure K8S Multi Node Cluster over AWS Cloud using Ansible :

πŸ”° Let’s Begin…

We don’t have any hosts or instances running

1. Launching EC2 Instances using Ansible :

>>> Create Role :

ansible-galaxy init ec2

>>> In tasks file :

>>> In vars file :

>>> In playbook setup.yml :

>>> Run the playbook :

πŸ‘‰πŸ» Instances launched and hosts file is been updated

2. Setting Up Master Node and Worker Nodes

In Master Node,

>>> Create Role :

ansible-galaxy init k8s_master

>>> In tasks file :

>>> In vars file :

In Worker Nodes,

>>> Create Role :

ansible-galaxy init k8s_nodes

>>> In tasks file :

>>> In vars file :

>>> In playbook k8s_setup.yml :

>>> Run the playbook :

3. Launching WordPress and MySQL DataBase Pods

>>> Create Role :

ansible-galaxy init wordpress

>>> In tasks file :

>>> In vars file :

>>> In playbook wordpress_setup.yml :

>>> Run the playbook :

πŸ”° On Browser :

πŸ”° GitHub URL :

https://github.com/Vrukshali-26/k8s-setup-with-wordpress-using-ansible.git

Finally our Task is completed successfully !!!!πŸ˜„βœŒπŸ»

Thanks for Reading !! πŸ™ŒπŸ»πŸ˜πŸ“ƒ

πŸ”° Keep Learning !! Keep Sharing !! πŸ”°

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store