Prerequisites

  • Users will need to create a base OS image in vSphere before starting this procedure.

  • Build image with Konvoy Image Builder (KIB)

  • If using GPU, prepare OS image for your NVIDIA GPU nodepool using Konvoy Image Builder instructions here: KIB for GPU

Create a vSphere Template for Your Cluster from a Base OS Image

Using the base OS image created in a previous procedure, DKP creates the new vSphere template directly on the vCenter server.

  1. Set the following vSphere environment variables on the bastion VM host:

    export VSPHERE_SERVER=your_vCenter_APIserver_URL
    export VSPHERE_USERNAME=your_vCenter_user_name
    export VSPHERE_PASSWORD=your_vCenter_password
    CODE

     

  2. Copy the base OS image file created in the vSphere Client to your desired location on the bastion VM host, and make a note of the path and file name.

  3. Create an image.yaml file and add the following variables for vSphere. DKP uses this file and these variables as inputs in the next step.

    build_name: "vsphere-rhel-79"
    packer_builder_type: "vsphere"
    packer:
      cluster: "example_zone"
      datacenter: "example_datacenter"
      datastore: "example_datastore"
      folder: "example_folder"
      insecure_connection: "false"
      network: "example_network"
      resource_pool: "example_resource_pool"
      template: "example_base_OS_template_name"
      vsphere_guest_os_type: "example_rhel8_64Guest"
      guest_os_type: "example_rhel7-64"
      #goss params
      distribution: "example_RHEL"
      distribution_version: "example_7.9"
      ssh_username: ""
      ssh_password: ""
      ssh_private_key_file = "" 
      ssh_agent_auth: false # is set to true, ssh_password and ssh_private_key will be ignored
    CODE

     

  4. Create a vSphere VM template with your variation of the following command:

    konvoy-image build images/ova/<image.yaml>
    CODE

    The Konvoy Image Builder uses the values in image.yaml and the input base OS image to create a vSphere template that contains the required artifacts needed to create a Kubernetes cluster. Give the file a suitable name using this suggested naming convention: creator-ova-vsphere-OS-ver-k8sver-unique_identifier. As an example, the filename you create might resemble dkp-ova-vsphere-rhel-84-1.21.6-1646938922.

    NOTE: To build an image in a GPU environment, use the overrides/nvidia.yamland see the referenced link KIB for GPU.

  5. DKP creates the new vSphere template directly on the vCenter server.

  6. Next steps are to deploy a DKP cluster using your vSphere template.