How to Install Kubernetes on CentOS and Ubuntu: A Step-by-Step Guide
Kubernetes is a powerful container orchestration tool that automates application deployment, scaling, and management. In this guide, we’ll walk you through the process of install Kubernetes on both CentOS and Ubuntu nodes. By the end, you’ll have a fully functional two-node Kubernetes cluster consisting of a master and a worker node.

Pre-requisites for Kubernetes Installation
Before we begin, make sure you meet the following requirements:
- Puppet Enterprise (PE) is installed, as we will be using Puppet to automate the configuration.
- Proper IP addressing for both Kubernetes master and worker nodes.
Node Configuration
In this setup, we will configure two sets of nodes: one with CentOS and the other with Ubuntu.
CentOS Node Configuration
- Kubernetes Master Node:
- Hostname:
kubernetesmaster.zippyops.com - IP:
192.168.1.180
- Hostname:
- Kubernetes Worker Node:
- Hostname:
kubernetesworker.zippyops.com - IP:
192.168.1.181
- Hostname:
Ubuntu Node Configuration
- Kubernetes Master Node:
- Hostname:
ubuntukubernetesmaster.zippyops.com - IP:
192.168.1.182
- Hostname:
- Kubernetes Worker Node:
- Hostname:
ubuntukubernetesworker.zippyops.com - IP:
192.168.1.183
- Hostname:
These configurations will ensure that your Kubernetes nodes are set up correctly and ready for deployment.
Setting Up Puppet Modules
To manage your Kubernetes nodes efficiently, we will use Puppet modules for the master and worker nodes. If you’re new to Puppet, it’s a configuration management tool that automates the deployment of software and system configurations.
Creating the Puppet Modules
Begin by creating the necessary modules on your Puppet master node.
- Create the Kubernetes Master Module:
pdk new module kubemaster - Create the Kubernetes Worker Module:
pdk new module kubeworker
Once you’ve created the modules, you’ll need to clone the relevant Kubernetes module from GitHub. This will allow Puppet to manage the configuration of both master and worker nodes.
Clone the Kubernetes Module
On your Puppet master, execute the following command to clone the Kubernetes module:
git clone git@github.com:tamilsaran/kubernetes-module.git
Configuration of the IP Addresses
In order to update the IP addresses for the Kubernetes nodes, navigate to the following path:
/etc/puppetlabs/code/environments/production/modules/kubeworker/manifests/worker.pp
Modify the IP addresses accordingly. For CentOS, you’ll set the master node’s IP, and similarly, for the Ubuntu nodes, configure the appropriate IP.
With the modules and IP configurations in place, you’re ready to deploy Kubernetes on both your CentOS and Ubuntu nodes.
Deploying Kubernetes on CentOS and Ubuntu
After setting up Puppet, you’ll need to deploy Kubernetes on both the master and worker nodes. Kubernetes provides various methods for installation, but the easiest way is to use the official Kubernetes package repository.
Install Kubernetes on CentOS
- Install Docker:
Kubernetes requires Docker for container management. Begin by installing Docker on both the master and worker nodes. - Set Up Kubernetes Repository:
Use the following commands to add the Kubernetes repository to your CentOS system:sudo cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF
Install Kubernetes Components:
Now, install the Kubernetes packages:
sudo yum install -y kubelet kubeadm kubectl
Start Kubernetes:
Start the Kubernetes service and enable it to start on boot:
sudo systemctl enable --now kubelet
Install Kubernetes on Ubuntu
For Ubuntu, the installation process is similar, with some variations in package management:
- Install Docker:
First, install Docker on both nodes:sudo apt update sudo apt install -y docker.io - Set Up Kubernetes Repository:
Add the Kubernetes repository to your Ubuntu system:sudo apt update && sudo apt install -y apt-transport-https curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - sudo apt update - Install Kubernetes Packages:
Install Kubernetes components on your master and worker nodes:sudo apt install -y kubelet kubeadm kubectl - Start Kubernetes:
Enable and start the Kubernetes service:sudo systemctl enable --now kubelet
Managing Kubernetes with Puppet
At this stage, both your CentOS and Ubuntu nodes should have Kubernetes installed. With Puppet, you can manage your infrastructure more efficiently. ZippyOPS offers consulting, implementation, and managed services to help streamline your Kubernetes management through DevOps, DevSecOps, DataOps, and Cloud solutions.
Whether you’re managing a microservices architecture or automating your operations with AIOps, ZippyOPS provides the expertise to help. We offer tailored services for infrastructure management, security, and MLOps, ensuring your Kubernetes environment is secure and optimized.
If you’re looking for professional Kubernetes management, don’t hesitate to reach out to ZippyOPS at sales@zippyops.com. For more details, explore our services at ZippyOPS Services or watch our tutorials on YouTube.
Conclusion on Install Kubernetes on CentOS and Ubuntu
In this guide, we’ve walked through the installation of Kubernetes on CentOS and Ubuntu nodes, setting up Puppet modules, and deploying Kubernetes using the official Kubernetes package repository. By following these steps, you can easily manage and scale your containerized applications.
If you’re ready to take your Kubernetes deployment to the next level, ZippyOPS offers expert consulting and managed services to optimize your infrastructure. Reach out to us today to enhance your Kubernetes experience.



