Skip to content

The repository for creating Kubernetes Cluster using Ansible

Notifications You must be signed in to change notification settings

divyanshuss/Kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Cluster Using Ansible

images (1)

The repository for creating Kubernetes Cluster using Ansible Roles.


The Roles

The folder named K8s_Cluster_Roles has three roles named EC2_instance , K8_Master , K8_Slave . The role launches two instances over aws cloud , configures one instance as Master , other instance as Slave respectively.


The inventory

The folder named /mydb is used to setup the dynamic inventory which will automatically load the IPs of the instances. It contains two files namely ec2.py and ec2.ini. Follow the changes made in the file and make them executable using

chmod +x filename

Export all the variables mentioned in the ec2.py file. ..
Check the dynamic inventory setup by runnig ec2.py file. Run the following command in the same directory

./ec2.py

The configuration file

Ansible configuration file is located in /etc/ansible/ansible.cfg as a default location. We add the following parameters to execute the playbook remotely - connection , remote user , path of key to your AWS account. Since the instances launch will not have power to executethe tasks add privilege escalation to your config file. Since, we going to run roles add the role path and certain other details as well.


The mainsetup file

The main setup file contains three hosts with their respective roles . The role which launches instance is run locally. The other two are run respectively on the name assigned to them while launching tag_Name_nameofinstance . In the end run this file to configure the entire structure using the command:

ansible-playbook filename

ARTICLE

You can go through the article more details .

67fb22aa0142b62effc23870f80cf39d

About

The repository for creating Kubernetes Cluster using Ansible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages