Skip to content

Set up a Kubernetes cluster with Ansible on CentOS 8 and Ubuntu 23.04. Includes playbooks for master and worker nodes, ensuring a streamlined deployment. Suitable for development and testing environments.

License

Notifications You must be signed in to change notification settings

ZioGuillo/Kubernetes-cluster-with-Ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Cluster using Ansible

CentOS 8 Ubuntu 23.04

This guide covers setting up a Kubernetes cluster using Ansible on CentOS 8 and Ubuntu 23.04.

Prerequisites

  • Clone the repository.
  • Create multiple VMs or physical servers for one master and several worker nodes. You can use tools like Vagrant for VM creation. See an example here.
  • Update the ad_addr in the env_variables file with the IP address of the Kubernetes master node.
  • Run the following command to setup the Kubernetes Master node.
  • Select the version Centos or Ubuntu.
ansible-playbook setup_master_node.yml
  • Once the master node is ready, run the following command to set up the worker nodes.
ansible-playbook setup_worker_nodes.yml
  • Once the workers have joined the cluster, run the following command to check the status of the worker nodes.
  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get nodes

Additional information

  • The IP addresses of the workers and masters added to the /etc/hosts file on all workers and masters as part of the prerequisites.yml playbook, if necessary or in case of DNS issues make sure the addresses have been added to /etc/hosts file.

About

Set up a Kubernetes cluster with Ansible on CentOS 8 and Ubuntu 23.04. Includes playbooks for master and worker nodes, ensuring a streamlined deployment. Suitable for development and testing environments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published