<mohammadrony>

Kubernetes Cluster

An Ansible playbook to configure Kubernetes cluster in CentOS 9.

Pre-requisites

Prepare ansible connection from ansible host to control plane and worker node. You can follow this document ansible setup to prepare the connection.

Update variable in playbook

Update the variables in kube control setup, kube node setup and post installation role.

Check ansible hosts file

Check hosts file for host-group and host-names with control plane and worker node host names. By default it would work as follows

[kcontrol]
vm-master

[knodes]
vm-worker

Run Ansible playbook

ansible-playbook playbook.yml

Access Kubernetes cluster from remote host

  • Find the config file for the cluster from Ansible control host's /home/ansible/kubeconfig file.
  • Copy the config file to remote host's ~/.kube/config file.

Thank you.