Task: Automate Kubernetes Cluster Using Ansible.

Rishabh
3 min readApr 27, 2021

Task Description:
đź”… Launch ec2-instances on AWS Cloud eg. for master and slave.
đź”… Create roles that will configure master node and slave node seperately.
đź”… Launch a wordpress and mysql database connected to it in the respective slaves.
đź”… Expose the wordpress pod and client able hit the wordpress ip with its respective port.

For the above task to be completed we should know few things about Kubernetes, Mysql and wordpress.

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.

The name Kubernetes originates from Greek, meaning helmsman or pilot. Google open-sourced the Kubernetes project in 2014. Kubernetes combines over 15 years of Google’s experience running production workloads at scale with best-of-breed ideas and practices from the community.

Pre-Requisites:

a. AWS Account for EC2 Instances
b. Ansible Controller Node
c. Basics About K8s Cluster and Yaml
d.

So let’s get right into the Task:

♦STEP1: Provisioning the EC2 Instances with K8s Cluster setup.

♦STEP2: Creating mysql.yml which will be later applied.

♦STEP3: Creating mywp.yml for Wordpress pod which will be later applied.

♦STEP4: Creating service.yml for Exposing wordpress pod which will be later applied.

♦STEP5: Creating main task file which will run every command of kubernetes according to our requirement.

♦STEP6: Running the task file using Ansible to configure the Cluster setup.

♦STEP7: Go To Browser and type the Public Ip of the pod where we just launched the “mywp”

♦STEP8: Finally just do the setup and will land to the login page

Thank You guys..Hope you all learned Something
With these 8 easy steps you can configure the whole setup.

If facing any problem please contact me:
Linkendin: https://www.linkedin.com/in/rishabh-465a85185/
github: https://github.com/Rishbah-76/task23-AWS-Ansible-Kubernetes-wordpress-setup-

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Rishabh
Rishabh

Written by Rishabh

Student from B.tech 2nd Year, A proud ARTH learner, love new technologies, Curious about many thing, likes to explore places, love eating pizza and much more.

No responses yet

Write a response