Create a Kubernetes cluster on vSphere with Kublr

Introduction

Purpose

Quick overview on how to create VMware vSphere Kubernetes clusters through the Kublr Platform.

Objectives

Deploy simple 1 master and 2 work node Kubernetes clusters for demo purposes.

Before you get started

First download and install Kublr-in-a-box at https://kublr.com/demo.

Prerequisites

System requirements for the cluster nodes

  1. x86 64-bit hardware
  2. At least 5Gb of RAM and 2 vCPU per master node
  3. At least 16Gb og RAM and 8 vCPU in sum for work nodes if you plan deploying Kublr Platform
  4. Supported OS on nodes: Ubuntu 16.04 LTS and above, RHEL 7.4 and above, CentOS 7.4 and above
  5. Direct connection to the virtual machine network
  6. Direct connection to vCenter and ESXi hosts
  7. 100Mb stable internet connection

Prepare a virtual machine template in vCenter

Kublr can use two kinds of VM templates:

  1. With installed vm-tools (This case is used for custom VM templates)
  2. With installed cloud-init (This case is used for prepared VM templates from the vendor)

For a quick start, you can use a prepared VM template with installed cloud-init from ova template.

You can upload this template to vCenter in two ways:

  1. Upload through vCenter UI
  2. Upload through govc import.ova

Make sure that the template in vCenter has vApp operations disabled:

  1. Go to the template and convert it to VM (corresponding operation is available in the list of template actions)
  2. Open “Configure” tab and disable vApp operations
  3. Convert the VM back to template

Creating a VMware vSphere cluster with Kublr

Powered by Kublr, Vanilla Kubernetes Cluster does not include any advanced Kublr features, suitable for running workloads.

See some cluster parameters description here.

To add a new cluster:

  1. On the left menu, click Clusters.
  2. Click Add Cluster. Add New Cluster The Select Installation Type dialog is displayed.
  3. In the Select Installation Type dialog, click Cluster.
  4. Click Continue Setup. Installation Type - Cluster The ADD CLUSTER dialog is displayed.
  5. In the ADD CLUSTER dialog, set Provider to “VMware vSphere”.
  6. From the Credentials list, select previously created VMware vSphere credentials.

    If credentials were not created previously, use Add New Credentials.

  7. Specify Cluster Name.

  8. Set in order listed:

    • Datacenter
    • Resource Pool
    • Datastore Type and Datastore
    • Resource Pool
    • Kubernetes Version vSphere-Add Cluster-General Settings
  9. If necessary, expand the Advanced Options and set them.

  10. Scroll to the Network Configuration section.

  11. Set:

    • Network
    • Network CIDR vSphere-Add Cluster-Network Configuration
  12. If necessary, expand the Advanced Options and set them.

  13. Scroll to the Master Configuration section.

  14. Specify the parameters of the master node(s) of your cluster as described below.

  15. From the Masters list, select the number of master nodes.

  16. Set Master X: IP for each node.

  17. For 3 and 5 master nodes configuration, optionally specify Load Balancer Address.

  18. Select from lists:

    • VM Template (If you don’t have template, please create one as specified here.)
    • VM Initialization Type
  19. Set:

    • Number of CPUs cores to use per VM.
    • Amount of RAM in GB to use per VM. vSphere-Add Cluster-Master Configuration
  20. If necessary, expand the Advanced Options and set them.

  21. Scroll to the Instance Group section (default name group1).

  22. Specify the parameters of the work node(s) in your group as described below.

  23. Select IP Address Allocation Mode.

  24. Enter number of Nodes to be provisioned in the node group.

  25. Select from lists:

    • VM Template (If you don’t have template, please create one as specified here.)
    • VM Initialization Type
  26. Set:

    • Number of CPUs cores to use per VM.
    • Amount of RAM in GB to use per VM.
  27. If necessary, set your own name for the instance group.

    Note You can also clone or delete the current instance group, or add another one. Instance Group-Operations

  28. If necessary, expand the Advanced Options and set them.

  29. Optionally, scroll to the Features section.

  30. If necessary, add features to your cluster, specifying parameters under:

    • Logging
    • Monitoring
    • Ingress Controller vSphere-Add Cluster-Features Configuration
  31. At the bottom of the ADD CLUSTER dialog, click Confirm and Install.

    A notification is displayed “Your cluster is being created. It might take a few minutes.”

  32. In the notification window, click OK.

    Your new cluster page is displayed on the Events tab showing the cluster creation progress.

Congratulations! You’ve just deployed a VMWare vSphere cluster in Kublr