๐ŸŽก 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