Installing Kubernetes on Proxmox: A Comprehensive Guide
In the rapidly evolving world of containerization and orchestration, Kubernetes has emerged as a powerful tool for managing and deploying containerized applications. Proxmox, an open-source platform for virtualization and containerization, provides an excellent foundation for running Kubernetes clusters. This guide will walk you through the process of installing Kubernetes on Proxmox, ensuring a smooth and efficient setup.
Prerequisites
Before we begin, ensure you have the following prerequisites in place:
- Proxmox VE 6.x installed on your hardware or virtual machine.
- A dedicated node for running the Kubernetes master and worker nodes.
- Access to the Proxmox web interface with appropriate permissions.
- Basic understanding of Linux commands and Kubernetes concepts.
Setting Up the Proxmox Node
First, let's prepare the Proxmox node for the Kubernetes installation. Log in to the Proxmox web interface and navigate to the node where you want to install Kubernetes. Then, follow these steps:

- Enable the Proxmox VE repository for your node. This can be done by running the following command in the node's console:
echo "deb http://download.proxmox.com/debian/pve stretch main" > /etc/apt/sources.list.d/pve-install-repo.list
- Update the package list and install the required packages:
apt update apt install -y bridge-utils openssh-server sudo
Installing Docker
Kubernetes requires Docker to be installed and running on each node in the cluster. Here's how to install Docker on your Proxmox node:
- Add the Docker GPG key and repository to your system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
- Update the package list and install Docker:
apt update apt install -y docker-ce docker-ce-cli containerd.io
Installing Kubernetes
Now that Docker is installed, we can proceed with the Kubernetes installation. We'll use the kubeadm tool to set up the Kubernetes cluster. First, make sure your node has the required kernel parameters:
echo "net.bridge.bridge-nf-call-ip6tables = 1" > /etc/sysctl.conf echo "net.bridge.bridge-nf-call-iptables = 1" > /etc/sysctl.conf sysctl -p
Next, install the required packages for kubeadm:

apt update apt install -y apt-transport-https curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - cat <(echo "deb https://apt.kubernetes.io/ kubernetes-xenial main") > /etc/apt/sources.list.d/kubernetes.list apt update apt install -y kubelet kubeadm kubectl kubernetes-cni apt-mark hold kubelet kubeadm kubectl
Initializing the Kubernetes Cluster
Finally, initialize the Kubernetes cluster using kubeadm. Run the following command in the node's console:
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
This command will initialize the Kubernetes cluster and provide you with a token to join worker nodes. Make sure to save this token for later use.
Setting Up the Kubernetes Configuration
To use kubectl, the Kubernetes command-line tool, you need to set up your user's kubeconfig file. Run the following commands to set up the configuration:

mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config
Installing a Pod Network Add-on
To enable communication between pods in the cluster, you need to install a pod network add-on. For this guide, we'll use Flannel:
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Joining Worker Nodes to the Cluster
Now that the Kubernetes master is set up, you can join worker nodes to the cluster using the token provided by the kubeadm init command. On each worker node, run the following command, replacing TOKEN and MASTER_IP with the appropriate values:
sudo kubeadm join MASTER_IP:MASTER_PORT --token TOKEN --discovery-token-ca-cert-hash SHA256:
Once the worker nodes have joined the cluster, you can verify their status using the following command on the master node:
kubectl get nodes
Congratulations! You have successfully installed Kubernetes on Proxmox and created a functional cluster. You can now start deploying your applications using Kubernetes.






















