Skip to content

Create a Kubernetes Cluster using Ansible on Contabo Unbuntu 22.04 VPS servers.

Notifications You must be signed in to change notification settings

medampudi/kube_cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Cluster Setup on Ubuntu 22.04 with Kubernetes 1.29 on Contabo VPS

This guide provides instructions to set up a Kubernetes cluster using kubeadm on Ubuntu 22.04 servers from Contabo VPS. The steps are based on a DigitalOcean tutorial but have been adapted for the updated environment and software versions. Additional inspiration and guidance were provided by the kubernetes-playbooks repository by Torgeir L. Hatlevik.

Prerequisites

  • Three Contabo VPS servers running Ubuntu 22.04.
  • SSH access to each server with root privileges.
  • Basic knowledge of Ansible for automating the setup process.

Inventory Setup

Prepare your hosts file to list the master and worker nodes:

[masters]
master ansible_host=<MASTER_IP> ansible_user=root

[workers]
worker1 ansible_host=<WORKER1_IP> ansible_user=root
worker2 ansible_host=<WORKER2_IP> ansible_user=root

Ansible Playbooks

1. Initial Setup

Create a user ubuntu and configure passwordless sudo access. The playbook is defined in initial.yml.

Run the playbook:

ansible-playbook -i hosts initial.yml

2. Install Kubernetes Dependencies

Install necessary dependencies and disable swap. The playbook is defined in kube-dependencies.yml.

Run the playbook:

ansible-playbook -i hosts kube-dependencies.yml

3. Master Node Initialization

Initialize the master node. The playbook is defined in master.yml.

Run the playbook:

ansible-playbook -i hosts master.yml

4. Worker Node Setup

Join worker nodes to the cluster. The playbook is defined in worker.yml.

Run the playbook:

ansible-playbook -i hosts worker.yml

Verifying the Cluster

To verify the cluster setup, SSH into the master node and run:

kubectl get nodes

You should see a list of your master and worker nodes in the Ready state.

Acknowledgments

This setup guide was inspired by:

About

Create a Kubernetes Cluster using Ansible on Contabo Unbuntu 22.04 VPS servers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published