Scale a Cluster

Learn how to scale a Kubernetes cluster on Oracle Linux Virtualization Manager.

You can scale the cluster nodes by using the kubectl scale command, either on the management cluster, or directly in the Oracle Linux Virtualization Manager workload cluster if it's self-managed.

Note:

You can also scale cluster nodes by editing the replicas option in the appropriate Kubernetes Cluster API Custom Resource file.

Scaling Worker Nodes in an Oracle Linux Virtualization Manager Cluster

Use the kubectl scale command to scale the number of worker nodes in a Kubernetes cluster on Oracle Linux Virtualization Manager.

You can scale the worker nodes in a Kubernetes cluster by running the kubectl scale command, either on the management cluster, or on the Oracle Linux Virtualization Manager workload cluster if it's self-managed.

  1. Get the name of the machinedeployments Custom Resource.

    Use the kubectl get command to retrieve this information, for example:

    kubectl get machinedeployments --namespace olvm
  2. Run the kubectl scale command, specifying the new number of worker nodes.

    Set the new number of worker nodes with the --replicas option. In this example, the name of the machinedeployments Custom Resource is mycluster-md-0:

    kubectl scale machinedeployment mycluster-md-0 --replicas 3 --namespace olvm
  3. Wait for the cluster to stabilize before performing any other scaling operations.

    You can monitor the status of the nodes by running the following command on the Oracle Linux Virtualization Manager cluster:

    watch kubectl get nodes -A

    The cluster is stable when all the cluster nodes show a status of Ready. Exit the command using Ctrl+C.

    The number of worker nodes in the cluster is scaled up or down to the number of replicas you set.

Scaling Control Plane Nodes in an Oracle Linux Virtualization Manager Cluster

Use the kubectl scale command to scale the number of control plane nodes in a Kubernetes cluster on Oracle Linux Virtualization Manager.

You can scale the control plane nodes in a Kubernetes cluster by running the kubectl scale command, either on the management cluster, or on the Oracle Linux Virtualization Manager workload cluster if it's self-managed.

  1. Get the name of the kubeadmcontrolplane Custom Resource.

    Use the kubectl get command to retrieve this information, for example:

    kubectl get kubeadmcontrolplane --namespace olvm
  2. Run the kubectl scale command, specifying the new number of control plane nodes.

    Set the new number of control plane nodes with the --replicas option. In this example, the name of the kubeadmcontrolplane Custom Resource is mycluster-control-plane:

    kubectl scale kubeadmcontrolplane mycluster-control-plane --replicas 3 --namespace olvm
  3. Wait for the cluster to stabilize before performing any other scaling operations.

    You can monitor the status of the nodes by running the following command on the Oracle Linux Virtualization Manager cluster:

    watch kubectl get nodes -A

    The cluster is stable when all the cluster nodes show a status of Ready. Exit the command using Ctrl+C.

    The number of control plane nodes in the cluster is scaled up or down to the number of replicas you set.