Blog Article:

Automating Kubernetes Provisioning on OpenNebula with Kubespray and Terraform

Kubernetes has become a core part of modern cloud infrastructure, but deploying and managing clusters on private cloud environments can introduce additional infrastructure and automation requirements.

To give Kubernetes teams more flexibility in how they build their environments, OpenNebula is now supported in the Terraform provisioning workflow of Kubespray, the open source tool for deploying production-ready Kubernetes clusters.

The integration brings together OpenNebula, Terraform, and Kubespray in a straightforward workflow: Terraform provisions the required infrastructure on OpenNebula, while Kubespray uses the generated inventory to deploy the Kubernetes cluster.

This gives teams running Kubernetes on OpenNebula another automated and repeatable way to provision their environments using established open source tools.

Why Use Terraform and Kubespray on OpenNebula?

Infrastructure as Code makes it easier to create consistent environments without manually repeating infrastructure configuration for every deployment.

With the new integration, Kubernetes infrastructure on OpenNebula can be defined through Terraform and provisioned consistently across environments. This can be particularly useful for teams managing multiple Kubernetes clusters or maintaining separate development, testing, and production environments.

The integration also extends the range of Kubernetes deployment approaches available on OpenNebula. OpenNebula already provides several ways to run Kubernetes, including OneKS, Cluster API, and integrations with Kubernetes ecosystem technologies. The Kubespray integration adds another option for teams that prefer an Ansible-based Kubernetes deployment workflow combined with Terraform for infrastructure provisioning.

This separation also keeps each tool focused on what it does best:

  • Terraform manages the infrastructure provisioning.
  • OpenNebula provides the underlying compute, networking, and storage infrastructure.
  • Kubespray deploys and configures the Kubernetes cluster.

The result is a more consistent path from infrastructure definition to a running Kubernetes environment.

How the Integration Works

The workflow starts with a Terraform configuration describing the desired Kubernetes infrastructure on OpenNebula. The integration provisions the required virtual machines from existing OpenNebula templates, configures their networking, and prepares them for Kubernetes deployment.

Terraform then generates the Ansible inventory required by Kubespray, including the appropriate control-plane, etcd, and worker node groups.

From there, users can follow the standard Kubespray deployment workflow to install Kubernetes.

The approach supports both straightforward cluster deployments and more advanced configurations, including high-availability control planes, named nodes, static IP addresses, node anti-affinity, and additional storage options.

The complete configuration and deployment instructions are available in the Kubespray OpenNebula documentation, so users can go directly from the overview here to the detailed implementation guide.

Explore Kubernetes on OpenNebula and discover how to deploy and operate Kubernetes across on-premises, cloud, and edge environments.  

Validated on OpenNebula 7.2

The integration has been tested end-to-end on a live OpenNebula 7.2 environment using Ubuntu 24.04 images.

Testing covered both a smaller Kubernetes deployment and a highly available configuration with three control-plane nodes and three workers. The HA deployment successfully provisioned the infrastructure and deployed the Kubernetes cluster, with the resulting environment validated for cluster operation and DNS resolution.

The integration is being contributed upstream to the Kubespray project.

For teams already using Kubespray and Terraform, this provides a new way to build Kubernetes environments on OpenNebula while keeping the workflow based on familiar, open source tooling.

Want to see Kubernetes on OpenNebula in action? Join us at Edgecase 2026, one Europe’s biggest Kubernetes events, where we’ll cover the infrastructure foundations of elastic Kubernetes environments, with a hands-on session showing how to deploy, scale, and operate Kubernetes with OneKS.

Razvan Petrescu

Cloud Systems Engineer at OpenNebula Systems

Sep 21, 2026

0 Comments

Submit a Comment