Learn KOP - Deploy Test Workload - Rafay Product Documentation

Part 4: Workload

What Will You Do

In this part of the self-paced exercise, you will deploy a test workload to your Amazon EKS cluster that will be used to change the load on the cluster and trigger Karpenter to scale the cluster up and down.


Step 1: Deploy Workload

In this step, you will create a workload on the cluster using the "inflate-workload.yaml" file which contains the declarative specification for our test workload.

The following items may need to be updated/customized if you made changes to these or used alternate names.

name: inflate-workload
namespace: default
project: defaultproject
type: NativeYaml
clusters: karpenter-cluster
payload: inflate.yaml
rctl create workload inflate-workload.yaml

If there were no errors, you should see a message like below

Workload created successfully

Now, let us publish the newly created workload to the EKS cluster. The workload can be deployed to multiple clusters as per the configured "placement policy". In this case, you are deploying to a single EKS cluster with the name "karpenter-cluster".

rctl publish workload inflate-workload

In the web console, click on Applications -> Workloads. You should see something like the following.


Step 2: Scale Workload

The test workload can be scaled to consume the resources of the cluster. Once the cluster resources are constrained, Karpenter will increase the number of nodes in the cluster as needed.

kubectl get deployments
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
inflate   0/0     0            0           62s
kubectl get nodes
NAME                                           STATUS   ROLES    AGE   VERSION
ip-192-168-21-112.us-west-2.compute.internal   Ready    <none>   64m   v1.28.8-eks-ae9a62a
kubectl scale deployment inflate --replicas 5
kubectl get pod -n default
NAME                       READY   STATUS    RESTARTS   AGE
inflate-56d689d486-kqhj2   1/1     Running   0          3m37s
inflate-56d689d486-nd89d   1/1     Running   0          3m37s
inflate-56d689d486-vv7bv   1/1     Running   0          3m37s
inflate-56d689d486-w4rbp   1/1     Running   0          3m37s
inflate-56d689d486-wzlgt   1/1     Running   0          3m37s
kubectl get nodes
NAME                                            STATUS   ROLES    AGE     VERSION
ip-192-168-185-147.us-west-2.compute.internal   Ready    <none>   8m27s   v1.29.6-eks-1552ad0
ip-192-168-93-53.us-west-2.compute.internal     Ready    <none>   90m     v1.29.6-eks-1552ad0
kubectl get pod -n default
NAME                       READY   STATUS    RESTARTS   AGE
inflate-7d57f774d4-92njk   1/1     Running   0          87s
inflate-7d57f774d4-bm8kv   1/1     Running   0          87s
inflate-7d57f774d4-nkxg5   1/1     Running   0          87s
inflate-7d57f774d4-v8tkq   1/1     Running   0          87s
inflate-7d57f774d4-vd4xw   1/1     Running   0          87s

Recap

Congratulations! At this point, you have successfully