Learn KOP - Scale MKS Cluster - Rafay Product Documentation

Part 2: Scale

What Will You Do

In this part, you will:


Step 1: Scale Nodes

In this step, we will scale the number of nodes within the cluster. You can scale the number of nodes up or down, depending on your needs. In this example, we will scale the number of nodes up to 2.

After a few minutes, you will see the new node as discovered and approved

After a few minutes, from the web console, we can see that the scale operation has completed and the number of "Ready" nodes is 2.


Download the cluster config from the existing cluster

- arch: amd64
  hostname: instance-20221129-15188
  operatingSystem: Ubuntu20.04
  privateip: 172.31.61.188
  roles:
    - Storage
    - Worker
  ssh:
    ipAddress: 152.70.157.140
    port: "22"
    privateKeyPath: mks-get-started2.pem
    username: ubuntu

The updated YAML file will look like this:

apiVersion: infra.k8smgmt.io/v3
kind: Cluster
metadata:
  labels:
    check1: value1
    check2: value2
  name: mks-get-started
  project: mks
spec:
  blueprint:
    name: default
    version: 1.20.0
  config:
    autoApproveNodes: true
    dedicatedMastersEnabled: false
    highAvailability: false
    kubernetesVersion: v1.24.6
    location: sanjose-us
    network:
      cni:
        name: Calico
        version: 3.19.1
      podSubnet: 10.244.0.0/16
      serviceSubnet: 10.96.0.0/12
    nodes:
      - arch: amd64
        hostname: instance-20221129-1516
        operatingSystem: Ubuntu20.04
        privateip: 172.31.61.40
        roles:
          - Master
          - Worker
          - Storage
        ssh:
          ipAddress: 129.146.141.203
          port: "22"
          privateKeyPath: mks-get-started1.pem
          username: ubuntu
      - arch: amd64
        hostname: instance-20221129-15188
        operatingSystem: Ubuntu20.04
        privateip: 172.31.61.188
        roles:
          - Storage
          - Worker
        ssh:
          ipAddress: 152.70.157.140
          port: "22"
          privateKeyPath: mks-get-started2.pem
          username: ubuntu
  type: mks
./rctl apply -f mks-get-started-config.yaml

You will see output similar to the following

{
  "taskset_id": "d27rwvk",
  "operations": [
    {
      "operation": "NodeAddition",
      "resource_name": "instance-20221129-15188",
      "status": "PROVISION_TASK_STATUS_PENDING"
    }
  ],
  "comments": "The status of the operations can be fetched using taskset_id",
  "status": "PROVISION_TASKSET_STATUS_PENDING"
}

From the web console, we can see that the node has been discovered, approved and will automatically be provisioned.

After a few minutes, from the web console, we can see that the scale operation has completed and the number of "Ready" nodes is 2.


Recap

Congratulations! At this point, you have successfully scaled the number of nodes in an MKS cluster