Configure K8 cluster using Ansible
Hello guys,
Here I came up with a new article in this article I configure the Kubernetes cluster using Ansible and created the cluster of Kubernetes.
So let me tell you what is Kubernetes First
Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.
It groups containers that make up an application into logical units for easy management and discovery. Kubernetes builds upon 15 years of experience of running production workloads at Google, combined with best-of-breed ideas and practices from the community.
Planet Scale
Designed on the same principles that allows Google to run billions of containers a week, Kubernetes can scale without increasing your ops team.
Never Outgrow
Whether testing locally or running a global enterprise, Kubernetes flexibility grows with you to deliver your applications consistently and easily no matter how complex your need is.
Run K8s Anywhere
Kubernetes is open source giving you the freedom to take advantage of on-premises, hybrid, or public cloud infrastructure, letting you effortlessly move workloads to where it matters to you.
For more information visit the site below.
Now let's move to the task
Task Description :-
?? Ansible Role to Configure K8S Multi Node Cluster over AWS Cloud.
?? Create Ansible Playbook to launch 3 AWS EC2 Instance
?? Create Ansible Playbook to configure Docker over those instances.
?? Create Playbook to configure K8S Master, K8S Worker Nodes on the above created EC2 Instances using kubeadm.
?? Convert Playbook into roles and Upload those role on your Ansible Galaxy.
?? Also Upload all the YAML code over your GitHub Repository.
?? Create a README.md document using markdown language describing your Task in creative manner.
?? Create blog about task and share on your LinkedIN profile.
Lets Begin:-
Step 1:- Creating configuration file for ec2 configuration
Step 2:- Configuration file of Ansible
Step 3:- Creating Roles for master and slave
# ansible-galaxy init master # ansible-galaxy init slave
Step 4:- configure file for master
Step 5:- Configuring slave
Step 6:- Now let's run the ec2 conf file to check whether we get the master and slave or not.
# ansible-playbook playbook name
It's working lets check-in GUI
Step 7:- Now lets run the Kubernetes configuration on master and slave
Let's log in to the master and check whether Kubernetes configure or not?
# Kubctl get node # kubeclt get pods -n kube-system
It's working lets create a deployment
Step 9:- create deployment
# Kubectl create deployment <name> <imagename>
So it works hope you like it ??
Any suggestion regarding this please DM me.
Thank you!!!??????