This playbook is intended to install and configure KUBERNETES Cluster on RHEL/CentOS 7,8 by Kubeadm.
Note: With RHEL OS you may face issues while installing docker lastest version if the OS is itself on old version.
Read this document carefully to have more understanding about this ansible playbook.
The playbook is intended to run on VM's with atleast 2 cores and 2GB RAM allocated. So please make sure, we have this much amount of resources available, else the playbook will fail.
Variables need to declared inside deploy_kubernetes/defaults/main.yml
-
KUBERNETES_MASTER => The node fqdn or hostname who will act as Kubernetes Cluster master.
-
MASTER_IP_ADDRESS => IP address of the above kubernetes master
-
CRIOVERSION => Required CRIO repository version
-
Other variables declared in deploy_kubernetes/vars/main.yml
- Basic knowledge of Linux, Git.
- Base OS repository should be configured.
- Internet connectivity of VM's (or all required respoitory configured offline)
- Communication already working between ansible control node and managed nodes.
One can use it's own inventory or create it's own inventory. Replace the hostnames in "inventory" file present here with hostnames of your environment.
Step | Description | Commands |
---|---|---|
1 | Download this playbook in your ansible server | # git clone https://github.com/HemantGangwar/kubernetesClusterRH8.git |
2 | Enter into the directory created | # cd kubernetesClusterRH8 |
3 | Update inventory file provided here with your node names. | # vi inventory |
4 | Update deploy_kubernetes/defaults/main.yml with required parameter | (example) KUBERNETES_MASTER: master.lab.example.com |
5 | Now execute the playbook | # ansible-playbook kubernetes.yml OR ansible-playbook kubernetes.yml -e KUBERNETES_MASTER=master.lab.example.com |
Note: The playbook is fully idempotent and can be safely used multiple times.
It contains 3 segments:
- Pre-Requsisites taking care of Run time disabling of selinux and switching off swap.
- A role named deploy_kubernetes containing master and worker deployment.
- Post-Requisite taking care of setting up Networking(weave) for Cluster.
Execution of playbook can be viewed on https://youtu.be/x7l7Ne2jvsw
This playbook is written by Hemant Gangwar, you can read more about author at https://learningtechnix.wordpress.com or follow on LinkedIN https://www.linkedin.com/in/hemant-gangwar-6a677b19/
- In version 30 June 2020 fixed an issue with playbook requiring static master name while joining Kubernetes nodes
- In version 10 July 2020 fixed issue of deprecated, package installation warning. And updated Inventory description.
- In version 5 Aug 2020 fixed dependency issue used in case of RedHat OS.
- In version 8 July 2022, it is updated to incorporate CRIO deployment as well.