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 NO 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

Create Cluster

Use the below command to create a vSphere Cluster

./rctl create cluster vsphere -f <config-file.yaml>

An illustrative template of the cluster spec YAML file for vSphere is shown below

apiVersion: infra.k8smgmt.io/v3
kind: Cluster
metadata:
  name: <cluster name>
  description: examplecluster for demo
  project: <project name>
  labels:
    env: dev
  annotations:
    key: value
spec:
  blueprint:
    name: <rafay blueprint name>
    version: <rafay blueprint version>
  cloudCredentials: <cloud credential name>
  type: vmware
  config:
      datacenter: <The vSphere data center name>
      datastore: <vSphere data store name>
      resourcePool: <vSphere resource pool>
      vmTemplate: <VM template name to be used for VM's>
      vmFolder: <vSphere VM Folder name where the cluster nodes will be launched>
      controlPlaneEndpointIP: <the IP address used for the control plane endpoint>
      vcenterCaTlsThumbprint: <The certificate thumbprint for the vCenter server>
      network:
        cni:
          name: calico
          version: v3.22.0
        devices:
          - dhcp4: true
            networkName: <vSphere Network name >
      controlPlane:
        machineCount: 1
        version: v1.23.5
        sshAuthorizedKeys: <Public key to configure remote SSH access to the nodes>
      workerNodes:
        machineCount: 1
        version: v1.23.5
        sshAuthorizedKeys: <Public key to configure remote SSH access to the nodes>

Delete Cluster

Use the below command to delete a vSphere Cluster

./rctl delete cluster <cluster-name>