Skip to content

CLI

Users can use RCTL to automate the lifecycle of operations associated with Gateway, vSphere Credentials and VMware Cluster Creation

Resource Create Get Delete
Gateway YES YES YES
Credentials YES NO YES
Clusters YES YES YES

Gateway

Create Gateway

Use this command to create a Gateway

./rctl create gateway <gateway-name>

Users can add more flags based on the gate requirement. The below help flag allows the users to view and utilize the required flags that can be associated with a new cluster

./rctl create gateway --help

Get Gateway

To retrieve the list of Gateway(s), use the below command

./rctl get gateway

Example Output

+-----------+---------------+--------------+------------------------------+
| GATEWAYID | NAME          | GATEWAY TYPE | CREATED AT                   |
+-----------+---------------+--------------+------------------------------+
| 4qkolkn   | demo-gateway  | vmware       | Tue Jul 19 09:38:02 UTC 2022 |
+-----------+---------------+--------------+------------------------------+
| q72dg2g   | gateway_1     | vmware       | Thu Jul 21 11:49:49 UTC 2022 |
+-----------+---------------+--------------+------------------------------+

To retrieve a single gateway, use the below command

./rctl get gateway <gateway-name>

Example Output

./rctl get gateway demo-gateway
+-----------+---------------+--------------+------------------------------+
| GATEWAYID | NAME          | GATEWAY TYPE | CREATED AT                   |
+-----------+---------------+--------------+------------------------------+
| 4qkolkn   | demo-gateway  | vmware       | Tue Jul 19 09:38:02 UTC 2022 |
+-----------+---------------+--------------+------------------------------+

Delete Gateway

Use the below command to delete a Gateway

./rctl delete gateway <gateway-name>

vSphere Credentials

Create Credentials

To create a vSphere Credentials, use the below command

./rctl create credentials vsphere  <cred-name>  --username  <username> --password   <password>  --vsphere-server  <vcenter address>  --gateway  <gateway-name>

Below is an example to create a credentials:

.//rctl create credentials vsphere  vsphere-cred  --username  demo-username --password  xxxxx  --vsphere-server  vcenter.sddc-xx-xx-xx-x.vmwarevmc.com  --gateway  demo-gateway

Delete Credentials

Use the below commands to delete a vSphere credential

./rctl delete credentials <cloud-cred-name>

vSphere Cluster

Cluster Lifecycle

Based on the declarative specification in the yaml file, the Apply command performs both Day-1 (provision) and Day-2 (scale/upgrade/update blueprint) operations.

./rctl apply -f <cluster.yaml>

Below is an illustrative example of a VMware vSphere cluster config spec

apiVersion: infra.k8smgmt.io/v3
kind: Cluster
metadata:
  name: demo-cluster
  project: defaultproject
spec:
  blueprint:
    name: minimal
    version: latest
  cloudCredentials: demo-creds
  config:
    controlPlane:
      machineCount: 1
      sshAuthorizedKeys:
      - ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxx
      version: v1.25.2
      numCPUs: 4
      memoryMiB: 10240
      diskGiB: 26
    controlPlaneEndpointIP: 10.109.10.215
    datacenter: SDDC-Datacenter
    datastore: WorkloadDatastore
    network:
      cni:
        name: calico
        version: v3.24.5
      devices:
      - networkName: sddc-network-k8s
      podCidrBlocks:
      - 192.178.0.0/16
    resourcePool: Compute-ResourcePool
    vmTemplate: ubuntu-2004-kube-v1.25.2
    nodepools:
      - machineCount: 1
        vmTemplate: ubuntu-2004-kube-v1.25.2
        name: nodepool-1
        sshAuthorizedKeys:
             - ssh-rsa xxxxxxxxxxxxxxxxxxxxxxx
        version: v1.25.2
        numCPUs: 3
        memoryMiB: 12288
        diskGiB: 27
  type: Vmware_vsphere
  • Provision the cluster
  • By changing the machine count field and the configuration using the apply command, users can scale the control plane and worker nodes
  • Users can update the version field (under control plane and worker node) to upgrade the control plane and worker nodes, and use the apply command to update the configuration
  • By changing the blueprint’s name and version, users can update the blueprint, and use the apply command to update the configuration

Download vSphere Cluster Config

Users can download the VMware vSphere Cluster config file using the below command

./rctl get cluster config <cluster name>

Delete Cluster

Use the below command to delete a vSphere Cluster

./rctl delete cluster <cluster-name>