Skip to content

Workload Basics

You can use RCTL to automate the deployment of workloads to a targeted set of managed clusters using a "placement policy". With a GitOps model, all these files can be securely stored as version controlled artifacts in a Git repo. Once updated, the Git system can be configured to trigger the pipeline.


Workload Definition

The workload definition file allows users to "declaratively" specify information about the workload that helps Rafay understand "which workload" needs to be deployed "on what clusters".

The workload "specification" is provided as a YAML file and is strongly recommended to be stored as a version controlled artifact in a Git repository.

An illustrative example of a workload definition for a Helm based workload is shown below.

name: km-redis
namespace: redis
type: Helm
clusters: eks-prod-east, eks-prod-west, eks-prod-europe, eks-prod-singapore, eks-prod-tokyo
payload: "./redis-with-sentine.tar.gz"
values: "./redis-values-production.yaml"

Placement Policy

The controller supports a spectrum of "multi cluster, placement policies" for workloads. This means it is possible to truly treat k8s clusters as "cattle" and automate global deployments. Currently, three types of placement policies are supported.


Specific Cluster Placement

This is the most basic policy and is well suited for deployments where the clusters are relatively static and few in number. An example placement policy is shown below. In this case, the controller will automatically deploy the workload to the list of "identified clusters" under management.

clusters: eks-prod-east, eks-prod-west, eks-prod-europe, eks-prod-singapore, eks-prod-tokyo

Label based Placement

This is a complex placement policy that is well suited for large multi cluster fleet deployments.

In this case, the controller will automatically deploy the workload to a dynamically generated list of "clusters" that satisfy the "specified cluster labels". In the example below, the workload will be deployed to all clusters with the label "east"

cluster_label_selectors: "type=east"

Location based Placement

This is a complex placement policy that is well suited for global, multi cluster fleet deployments.

In this case, the controller will automatically deploy the workload to a dynamically generated list of "clusters" that match the "specified cluster location. Note that you can also achieve similar results by using the "label based placement" policy.

In the example below, the workload will be deployed to all clusters with the location "aws/us-east-1"

cluster_locations: "aws/us-east-1"