Kubernetes on Proxmox: A Practical Guide

Kubernetes on Proxmox: A Practical Guide

Learn how to set up and manage Kubernetes on Proxmox with this practical guide, covering installation, configuration, and best practices for optimal performance.

Sam Weaver
Sam Weaver

Table of Contents

Deploying and managing Kubernetes can be complex, but the proper infrastructure can significantly simplify the process. Proxmox Virtual Environment (PVE) is a powerful open-source platform for managing virtual machines and containers. With its robust virtualization capabilities, it provides a solid foundation for running Kubernetes clusters.

This guide demystifies setting up and managing Kubernetes on Proxmox, offering clear, actionable steps and practical advice. We'll also explore the advantages of using Proxmox for Kubernetes, the essential prerequisites, and the installation process. Beyond the basics, we'll explore advanced topics like high availability, disaster recovery, performance optimization, and security best practices.

Unified Cloud Orchestration for Kubernetes

Manage Kubernetes at scale through a single, enterprise-ready platform.

GitOps Deployment
Secure Dashboards
Infrastructure-as-Code
Book a demo

Key Takeaways

  • Proxmox simplifies Kubernetes management: The Proxmox web interface streamlines cluster administration and resource allocation, offering a user-friendly experience whether you choose VMs or LXCs for your Kubernetes nodes.
  • High availability requires more than just infrastructure: A resilient Kubernetes cluster on Proxmox relies on a multi-node control plane, effective load balancing, and a solid disaster recovery strategy. Design your applications with resilience in mind, using multiple replicas and health checks.
  • Continuous monitoring and optimization are essential: Integrate external monitoring tools with Proxmox for granular insights into cluster performance. Monitor resource usage, network health, and application behavior to address potential issues and ensure optimal scaling proactively. Manage your Kubernetes configurations as code for streamlined upgrades and maintenance.

What is Kubernetes, and Why Run it on Proxmox?

What is Kubernetes?

Kubernetes is open-source software for automating the deployment, scaling, and management of containerized applications. Instead of manually managing individual containers, Kubernetes provides a resilient platform to run distributed systems. It handles the complexities of scheduling, networking, and storage, allowing you to focus on building and deploying your applications. Think of it as a sophisticated control plane for your containers, ensuring they run reliably and efficiently across a cluster of machines.

Why Proxmox for Kubernetes?

Proxmox VE addresses critical infrastructure management challenges that emerge when deploying Kubernetes in self-hosted or on-premises environments. By providing a virtualization layer with enterprise-grade features wrapped in an accessible interface, Proxmox eliminates operational friction that organizations would otherwise need to resolve manually when working directly with bare-metal Kubernetes. Here are some examples below:

Problem: Standardized Node Creation at Scale

Proxmox solves the repetitive, error-prone process of provisioning identical Kubernetes nodes by enabling template-based VM/LXC cloning. The platform allows administrators to:

  • Create golden images for worker nodes with preinstalled dependencies (e.g., container runtimes, kubeadm)
  • Clone customized templates into fully configured nodes in seconds2
  • Centrally manage storage allocations, NIC configurations, and hardware profiles

Without Proxmox, teams must:

  1. Manually install OSes on each physical machine
  2. Write custom scripts (Ansible, Terraform) to homogenize configurations
  3. Maintain separate PXE boot servers or disk imaging tools
  4. Handle driver/firmware inconsistencies across heterogeneous hardware

This process introduces significant overhead, particularly when scaling beyond three nodes. A misconfigured script or missed package in one node can create cluster instability

Problem: Granular Resource Control Across Cluster Layers

Proxmox provides a hierarchical resource management model:

  • Cluster-level: Allocate CPU/memory shares between VMs/LXCs
  • VM-level: Enforce hard limits via cpuunits and memory parameters
  • Storage-tier: Separate Kubernetes etcd volumes onto high-IOPS NVMe pools

The web interface surfaces real-time metrics (CPU steal time, memory ballooning) that help correlate Kubernetes pod issues with underlying hypervisor resource contention. By contrast, native Kubernetes offers:

  • ResourceQuotas: Namespace-level constraints
  • LimitRanges: Default requests/limits for pods
  • Vertical Pod Autoscaler: Dynamic resource adjustment

However, these operate in isolation from the physical layer. Diagnosing issues like noisy neighbors requires correlating kubectl top pod data with node-exporter metrics, then manually cordoning nodes—a process that lacks Proxmox’s integrated visibility

Problem: Cross-Layer Fault Tolerance

Proxmox enhances Kubernetes resilience through:

  • HA Groups: Automatically restart failed VMs/LXCs on healthy hosts
  • Ceph Integration: Replicated storage for etcd persistent volumes
  • QEMU Live Migration: Evacuate nodes during hardware maintenance

These features complement Kubernetes' pod rescheduling but operate at the infrastructure layer, protecting against host-level failures.

Manual Kubernetes Approach:
Achieving equivalent resilience without Proxmox requires:

  1. Deploying a triplicated control plane across physical servers
  2. Implementing software-defined storage (Rook Ceph, Longhorn)
  3. Configuring keepalived+HAProxy for load balancer failover
  4. Scripting bare-metal recovery workflows

Prerequisites

Before installing Kubernetes on Proxmox, ensure you have the necessary hardware and software components.

Hardware Requirements

A single server might suffice for a small development environment. However, the production Kubernetes clusters requires more robust resources. For production, aim for at least six bare-metal servers: three smaller servers for the control plane and three larger ones for worker nodes. This setup provides redundancy and allows for scaling. A robust network infrastructure is crucial, especially for production. While virtualized servers within Proxmox can work for testing, bare metal offers better performance and avoids nested virtualization complexities. Ensure your servers have sufficient CPU, memory, and storage.

Software Prerequisites

You'll need a working Proxmox VE installation. Before initializing the Kubernetes cluster, install your preferred container runtime on your Proxmox worker nodes. Common choices include Docker and contained. Ensure the qemu-guest-agent is installed and running within your VMs for improved communication between guest and host operating systems.

Network Configuration

Plan your network configuration carefully, especially for high-availability clusters. Reserve sufficient IP addresses for your control plane and worker nodes. For advanced networking features within your Kubernetes cluster, consider a CNI plugin like Calico or Cilium.

Install Kubernetes on Proxmox

This section outlines how to install a Kubernetes cluster on Proxmox. It covers setting up the virtual machine, installing Kubernetes components, and configuring the basic cluster.

Set Up VMs or LXCs

To run Kubernetes on Proxmox, you can choose between virtual machines (VMs) or Linux Containers (LXCs). VMs offer better isolation, similar to bare metal servers, while LXCs provide a lighter option with less overhead and are suitable for resource-constrained environments. Before you create your cluster, ensure your Proxmox worker nodes have your preferred container runtime installed and configured.

Install Kubernetes Components

After setting up your VMs or LXCs, install the core Kubernetes components. kubeadm streamlines cluster creation. Consider using tools like OpenTofu (a Terraform fork) and Cloud-init to automate VM provisioning.

Configure the Cluster

After installing the components, configure the cluster. This involves setting up the control plane, joining worker nodes, and ensuring network connectivity. A single Proxmox host works for testing, but production environments need multiple nodes for redundancy and high availability. Starting with one control plane node and adding more simplifies the initial configuration. For high availability, use at least three control plane nodes.

Best Practices for Managing Kubernetes Cluster on Proxmox

After successfully installing Kubernetes on Proxmox, focus on managing and optimizing your cluster for production workloads. These best practices cover resource allocation, security, networking, and configuration automation.

Allocate and Manage Resources

Resource management is crucial for Kubernetes. Without proper resource requests and limits defined for your pods, you risk resource exhaustion, where some applications might starve while others over-consume. Always set these limits to ensure predictable performance. Use the Proxmox web interface to monitor CPU, memory, network, and disk usage on a per-VM or per-container basis. This granular view helps identify bottlenecks and optimize resource allocation.

Secure Your Cluster

Kubernetes security requires a multi-layered approach. One common mistake is using the latest tag for container images. This can introduce instability and security vulnerabilities. Instead, use specific image tags tied to your application version, Git commit hash, or build number. Additionally, understand how to use pods effectively and implement proper security contexts. Overlooking these aspects can create significant security risks.

Set Up Networking and CNI Plugins

Networking is a critical component of any Kubernetes cluster. Consider using a CNI plugin like Cilium for enhanced networking and security policies. Cilium offers features like network policy enforcement, load balancing, and observability. While setting up networking, remember that you can use the Proxmox UI to monitor the performance and resource usage of your VMs, providing a holistic view of your cluster's health.

Automate and Manage Configurations

Effectively managing Kubernetes configurations involves treating your YAML manifests as code. Store them in a version control system like Git and leverage tools like Helm to manage and template these files. This practice ensures consistency and repeatability and simplifies deployments.

Build Resilient Kubernetes Cluster on Proxmox

High availability (HA) and disaster recovery (DR) are critical for production Kubernetes deployments.

Set Up a Multi-Node Cluster

A single-node Kubernetes cluster isn't suitable for production. A highly available control plane requires at least three master nodes. Bare-metal deployments are generally recommended for production HA to avoid the overhead of virtual machines and ensure each node has sufficient resources.

Implement Load Balancing

With a multi-node control plane, you'll need a load balancer to distribute traffic across your master nodes. For production, a hardware load balancer with BGP offers optimal performance and reliability. Ensure your network configuration, including IP addressing, can handle the demands of your Kubernetes cluster. If a hardware solution isn't an option, consider MetalLB for bare-metal load balancing.

Backup and Recover Your Cluster

Protecting your cluster configuration and application state is essential. Treat your Kubernetes manifests as code and store them in a version control system like Git. This practice enables easy rollback to previous configurations. Regularly back up your persistent volumes to ensure data durability. Create a disaster recovery plan that includes restoring your cluster from backups and validating its functionality. Tools like Velero can simplify these operations.

Design Resilient Applications

Infrastructure HA is only one piece of the puzzle. Your applications must also be designed for resilience. Ensure your deployments use multiple replicas to handle node failures. Implement health checks and liveness probes to monitor the health of your pods. Consider using StatefulSets for applications requiring persistent storage and ordered deployments. Remember, a single container instance won't automatically restart if a node fails; Kubernetes reschedules it, which takes time.

Optimize and Scale Your Kubernetes Cluster Performance on Proxmox

Once your Kubernetes cluster is running on Proxmox, ensure it performs optimally and scales to meet your needs. This involves tuning your virtual machines and containers, optimizing network and storage configurations, and implementing appropriate scaling strategies.

Tune VMs and Containers

Start by monitoring resource utilization. Proxmox’s web interface offers a dashboard with metrics for CPU, memory, network, and disk usage. For example, consistently high CPU usage on a particular VM might mean increasing its allocated CPU resources or optimizing the application running within it. Similarly, container memory usage should be monitored to ensure they have enough resources to operate efficiently without excessive swapping. Consider setting resource requests and limits for your containers to prevent resource starvation and ensure predictable performance.

Optimize Network and Storage

Network and storage performance are critical for Kubernetes. Integrating external monitoring tools with Proxmox can provide deeper insights and customizable alerts beyond Proxmox's basic monitoring features. Consider tools that track network latency, throughput, and I/O operations per second (IOPS) for your storage volumes. For storage, consider faster storage technologies like SSDs or NVMe drives, and ensure your storage is appropriately sized for your workload. Effective monitoring helps identify bottlenecks and informs optimization efforts. Properly configuring your Container Network Interface (CNI) plugin is also crucial for optimal network performance within the cluster.

Scale Horizontally and Vertically

Proxmox allows both horizontal and vertical scaling. Vertical scaling increases the resources of existing VMs, such as adding more CPU or memory. Horizontal scaling adds more VMs (or nodes) to your Kubernetes cluster, distributing the workload across more machines and improving overall capacity and resilience. Command-line tools like pveperf, pve-top, and pvesh provide valuable data to inform your scaling decisions. Use these tools to understand resource utilization patterns and identify when scaling is necessary. The best scaling strategy—horizontal, vertical, or combination—depends on your application's specific needs and workload characteristics. Using the Horizontal Pod Autoscaler (HPA) in Kubernetes can automate scaling based on metrics like CPU utilization.

Monitor and Maintain Your Kubernetes Cluster on Proxmox

Once your Kubernetes cluster is up and running on Proxmox, ongoing monitoring and maintenance are crucial for reliability and performance. This involves selecting the right monitoring tools, effective troubleshooting, and a robust upgrade strategy.

Choose Monitoring Tools

Proxmox offers essential monitoring through its web interface, displaying metrics like CPU, memory, network, and disk usage at both the VM and container level. However, for deeper insights and customizable alerts, integrate external monitoring tools. Prometheus and Grafana, for example, allow for granular data collection, sophisticated dashboards, and automated alerting—essential for managing production Kubernetes clusters.

Troubleshoot Common Issues

Troubleshooting Kubernetes on Proxmox often begins with the Proxmox UI. Use it to access your VMs and check their performance and resource usage. Keep your initial Kubernetes configurations simple. Avoid unnecessary complexity early on, focusing on understanding core components and their interactions. For issues within the Kubernetes cluster itself, kubectl commands are your primary tools for inspecting resources, logs, and events.

Upgrade Your Cluster

Regularly upgrading your Kubernetes cluster is essential for security and new features. Manage your Kubernetes manifests as code in a version control system like Git. Tools like Helm or Kustomize further streamline upgrades by managing and templating configuration files, ensuring consistency and repeatability. Always test upgrades thoroughly in a non-production environment before applying them to your live applications.

Explore platforms like Plural, which streamline cluster upgrades through automated workflows, compatibility checks, and proactive dependency management for seamless, scalable operations. Visit Plural.sh to learn more, or schedule a demo today.

Plural | Enterprise Kubernetes management, accelerated.
Use Plural to simplify upgrades, manage compliance, improve visibility, and streamline troubleshooting for your Kubernetes environment.

Unified Cloud Orchestration for Kubernetes

Manage Kubernetes at scale through a single, enterprise-ready platform.

GitOps Deployment
Secure Dashboards
Infrastructure-as-Code
Book a demo

Frequently Asked Questions

Why should I use Proxmox for my Kubernetes cluster?

Proxmox simplifies managing the underlying infrastructure for your Kubernetes cluster. It streamlines resource allocation by allowing you to run multiple VMs or LXCs on a single server. It also provides a user-friendly web interface for managing your virtual environment and offers high-availability features for building resilient clusters. This combination makes Proxmox a compelling choice for hosting Kubernetes.

What are the hardware requirements for running Kubernetes on Proxmox?

While a single server might suffice for testing, a production-ready Kubernetes cluster on Proxmox ideally uses at least six bare-metal servers: three for the control plane and three for worker nodes. Ensure sufficient CPU, memory, and storage resources on each server. A robust network infrastructure with a hardware load balancer and BGP routing is also recommended for production deployments.

How do I set up high availability for my Kubernetes cluster on Proxmox?

High availability requires a multi-node control plane with at least three master nodes. The preferred solution for distributing traffic across these nodes is a hardware load balancer with BGP. Ensure your applications are also designed for resilience by using multiple replicas, health checks, and liveness probes. Regular backups and a well-defined disaster recovery plan are also essential.

What are some common challenges when running Kubernetes on Proxmox, and how can I address them?

Challenges include network latency, resource mismanagement, and security misconfigurations. To mitigate latency, optimize your network and co-locate services. To prevent resource exhaustion, set limits for your pods. To address kernel issues, ensure compatibility between your Proxmox host and guests, correctly configure firewalls, and keep security patches updated.

How can I monitor and maintain my Kubernetes cluster on Proxmox?

Proxmox's web interface provides basic monitoring capabilities. Integrate external tools like Prometheus and Grafana for more advanced monitoring and alerting. Use kubectl for troubleshooting within the Kubernetes cluster itself. Regularly upgrade your cluster and applications, managing your configurations as code with tools like Git, Helm, and Kustomize.

Tutorials

Sam Weaver Twitter

CEO at Plural