Scaling nodes in Kubernetes clusters can be slow due to the time taken for new nodes to be provisioned. This time taken can include waiting on rook-ceph to become available along with mounting volumes. A cluster may need to scale if all nodes in the cluster are running at their full capacity, or if there is some burst processing, or HA required.
To reduce the time needed to wait for another node to be provisioned, you can overprovision the cluster by scheduling low priority pods with resource requests that cause the cluster to scale. For example, sizing the resource request of the overprovisioning pod to match size of a node, will scale an extra node.
The kdb Insights Overprovisioning chart is responsible for initializing lower-priority pods which should request the majority resources of a node on a cluster. The pods are used for the reservation of resources.
Since the overprovisioning pods are marked with a lower priority, when the cluster reaches resource capacity, these would be evicted to free up space for any pending pods. If cluster autoscaling is enabled, this would cause the cluster to scale and the pod to be rescheduled for a new node.
Pod Priority is a Kubernetes feature that allow you to assign priorities to pods. Priority indicates the importance of a pod relative to other pods. When a cluster is low on memory/cpu resources, lower-priority pods are removed/evicted by the scheduler. This is done in order to make space for higher-priority pods waiting to be scheduled.
Priority class value
The priority class value used by the chart should be set to a low value. The default is deliberately set to a large negative number to ensure it will be evicted by other pods. Ensure that this value is lower than the other pods in your application.
# Specifiy details of the priority class create
ReplicaCount and Resources
To use the chart, you must provide the following
resource values. These should align with the maximum resources of a node within their cluster.
|Number of nodes to provision via overprovisioning pod replicas
|Requested CPU for each overprovisioning pod
|Requested memory for each overprovisioning pod
The example yaml below defines how a user would overprovision 2 additional nodes. The overprovisioning pods are requesting 8 CPUs and 64GB of memory. This is assuming that resources defined on each of the nodes are slightly larger, therefore the overprovisioning pods are requesting the majority resources.
In order to run the chart you will need access to the KX Nexus repository, and an associated image pull secret for your cluster. If you've already installed kdb Insights Enterprise, you can re-use the same secret.
Confirm the repo has been added
helm repo ls
Confirm the image pull secret exists
kubectl get secrets
NAME TYPE DATA AGE
kxi-nexus-pull-secret kubernetes.io/dockerconfigjson 1 7d20h
Otherwise, the easiest way to setup the prerequisites is to use the kdb Insights CLI. The below command will setup the necessary secrets needed to install the chart.
kxi install setup
If you are using the CLI, and have not already added the repo and secrets, they can be manually installed as follows:
Add the KX Helm repo
helm repo add --username <username> --password <password> kx-insights https://nexus.dl.kx.com/repository/kx-insights-charts
Setup the image pull secret
An image pull secret is required in order to pull images from a private Docker registry. Using your credentials for the KX Nexus registry, you can create a secret for pulling these images.
kubectl create secret docker-registry kxi-nexus-pull-secret \
Create values file
- name: kxi-nexus-pull-secret
Installing the chart
Using Helm, you can lookup the latest chart version:
helm search repo kx-insights/kxi-overprovisioning --versions
You can then install the chart with the command below, using the
values.yaml from above:
helm install kxi-overprovisioning kx-insights/kxi-overprovisioning --version=<version> -f values.yaml