Skip to content

Overview

In Rafay, clusters and workloads are deployed in the Rafay Org in the context of a Project.

Users can use RCTL to automate the lifecycle management of clusters. Specifically, the operations listed in the table below can be fully automated using RCTL.

Resource Create Get Update Delete Publish Unpublish
Cluster YES YES YES YES N/A N/A

Create Cluster

Imperative

Use this command to create a cluster object in the configured project in Rafay. You can optionally also specify the cluster blueprint during this step.

./rctl create cluster imported qa-cluster -l sanjose
./rctl create cluster imported prod-cluster2 -l sanjose -b prodblueprint

Note

In the current version, RCTL based cluster creation is limited to imported clusters. Support for other cluster types will be added shortly.


Declarative

You can also import a cluster into Rafay based on a version controlled cluster spec that you can store in a Git repository. This enables users to develop automation for reproducible infrastructure.

./rctl create cluster -f cluster-spec.yml

An illustrative example of the cluster spec YAML file is shown below

kind: Cluster
metadata:
  # set the name of the cluster
  name: demo-imported-cluster-01
  # specific the project name to create the cluster
  project: defaultproject
spec:
  # type can be "imported"
  type: imported
  # blueprint below is optional, if not specified, default value is "default"
  blueprint: default
  # location, can be custom or predefined
  location: aws/eu-central-1

List Clusters

Use this command to retrieve the list of clusters available in the configured project. In the example shown below, there are four clusters in this project.

./rctl get cluster

+--------------------------------+----------+
|              NAME              |   TYPE   |
+--------------------------------+----------+
| rafaypoc-eks-existing-vpc-cicd | aws-eks  |
| demo-spot-eks                  | aws-eks  |
| demo-vmware-sjc                | manual   |
| demo-aks-east                  | imported |
+--------------------------------+----------+

Get The Specific Cluster Info

Use this command to retrieve the a specific cluster available in the configured project.

./rctl get cluster <cluster-name>

Below is the illustrative example of the "demo-spot-eks" cluster information of the current project:

./rctl get cluster demo-spot-eks

+---------------+-----------------------------+-----------------------------+---------+--------+---------------+
|     NAME      |         CREATED AT          |         MODIFIED AT         |  TYPE   | STATUS |   BLUEPRINT   |
+---------------+-----------------------------+-----------------------------+---------+--------+---------------+
| demo-spot-eks | 2020-08-11T16:54:25.750659Z | 2020-09-23T04:05:00.720032Z | aws-eks | READY  | eks-blueprint |
+---------------+-----------------------------+-----------------------------+---------+--------+---------------+
Or you can use below command to get more cluster information in json or yaml format

./rctl get cluster <cluster-name> -o json
./rctl get cluster <cluster-name> -o yaml


Delete Cluster

Authorized users can automate the deletion of an existing cluster in the configured project using RCTL.

./rctl delete cluster <cluster-name>

Update Cluster Blueprint

Use this command to use RCTL to update the cluster blueprint associated with a given cluster.

./rctl update cluster <cluster-name> -blueprint <blueprint-name>

Download Kubeconfig

Users can use RCTL to download the Kubeconfig for clusters in the configured project. All access will be performed via Rafay's Zero Trust Kubectl access proxy.

./rctl download kubeconfig [flags]

By default, a unified Kubeconfig for all clusters in the project is downloaded. If required, users can download the Kubeconfig for a selected cluster.

./rctl download kubeconfig --cluster <cluster-name>