Kubernetes

Rancher Node Template VMware ESXi – Ubuntu Cloud Image

In one of the Youtube videos I had created some time ago, one of the questions that keep coming up is how you create the Rancher Node Template VMware configuration. Specifically, many run into challenges with the template portion of the Node template configuration. How do you create the VMware template needed for cloning as the Kubernetes hosts? Let’s look at a few things I have learned with this process so you know what I know on the subject.

Read my other post on how to Create Kubernetes Cluster with Rancher and VMware vSphere step-by-step.

Rancher Node Template VMware

The Rancher Node Template is a template Rancher uses to deploy virtual machines to run Kubernetes. When you create a new Rancher-controlled Kubernetes cluster and choose VMware vSphere as the target environment, Rancher uses the node template for the configuration settings needed to communicate with VMware vSphere, including:

  • The vCenter Server address
  • The port
  • The username and password for communicating with vCenter
  • The virtual networking configuration
  • The vSphere template to use for deploying the VMs for Kubernetes
  • Other Kubernetes-specific configuration

The section we are focusing on with this post is the vSphere template. The vSphere template is used when Rancher begins the deployment to clone out the VMs. It is important to note, that you can’t use just any virtual machine template. If you try to use a customized Ubuntu Server template that you have customized and installed, it most likely will not work.

It is because Rancher depends on a specific vSphere template built upon the Ubuntu cloud image. What is an Ubuntu Cloud Image?

Ubuntu Cloud Image

Ubuntu Cloud Images are the official Ubuntu images pre-installed for the cloud. They are delivered as disk images that have been customized by Ubuntu engineering to run on public clouds that provide Ubuntu Certified Images, Openstack, LXD, and more.

Where do you download the Ubuntu Cloud Images? You can download the latest Ubuntu cloud images here:

Downloading an Ubuntu Cloud image for Rancher Node Template
Downloading an Ubuntu Cloud image for Rancher Node Template

In my testing, Rancher does not work with the latest Ubuntu Server images – Jammy 22.04. Instead, you will need to stick with the Ubuntu Server 20.04 LTS images. Typical errors I have seen in my testing:

  • Failed to connect to SSH – This means you are not using an Ubuntu cloud image and most likely using a vSphere template based on a normal installation of Ubuntu Server
  • Failed to deploy Docker – You have probably used an unsupported Ubuntu cloud image, such as Ubuntu Server 22.04.

Download the .OVA appliance file for VMware.

Download the VMware OVA appliance file for Ubuntu Server 20.04 LTS cloud image
Download the VMware OVA appliance file for Ubuntu Server 20.04 LTS cloud image

Convert the Ubuntu Cloud Image to a vSphere template

After you have downloaded and deployed the OVA template (do not power on), you convert it to a VMware vSphere template.

Ubuntu Server 22.04 LTS Cloud image deployed and converted to a vSphere template
Ubuntu Server 20.04 LTS Cloud image deployed and converted to a vSphere template

Rancher Node Template VMware configuration

To create a node template in Rancher, navigate to Cluster Management > RKE1 Configuration > Node Templates > Add Template. Under 3. Instance Options, select your Ubuntu cloud image under the Template configuration.

Rancher Node Template VMware configuration pointing to the Ubuntu cloud image
Rancher Node Template VMware configuration pointing to the Ubuntu cloud image

Once you have selected and saved the Rancher Node Template VMware configuration, you can use the node template when deploying a new Kubernetes cluster using Rancher.

Choosing your Rancher Node Template when deploying a Kubernetes cluster
Choosing your Rancher Node Template when deploying a Kubernetes cluster

Video overview of Rancher Node Template VMware creation

Rancher Node Template VMware FAQs

  • What is a Rancher Node Template? A rancher node template is a configuration template used when deploying Kubernetes clusters. The Rancher node template VMware configuration includes which vCenter Server you are communicating with, the credentials for communicating, the vSphere template being used, and many other configuration components.
  • What is a VMware vSphere template? A vSphere template is a vSphere object that allows quickly deploying virtual machines that can be quickly customized during deployment.
  • What is an Ubuntu cloud image? An Ubuntu cloud image is a special-purpose Ubuntu image that is built specifically for deploying in public cloud environments. It is the image needed for deploying a Rancher cluster on VMware vSphere with a vSphere template. After downloading the Ubuntu cloud image, you deploy it to vSphere and convert it to a virtual machine template. This is the template you point to in your Rancher node template.

More Kubernetes posts

Wrapping Up

The Rancher node template VMware configuration is straightforward and can be completed quickly by downloading an Ubuntu cloud image for Ubuntu Server 20.04 LTS, deploying, and then converting to a template. After conversion, the Rancher node template points to this vSphere template for deploying the Kubernetes nodes.

Back to top button