Search code examples
kubernetesarangodbhorizontal-scaling

Horizontal Pod Autoscaler with the ArangoDB Kubernetes Operator


Would it be possible to use the Kubernetes Horizontal Pod Autoscaler with the ArangoDB Kubernetes Operator?


Solution

  • Firstly, it would be better if you specify your need in detail, such as what you want to scale, or do you want to scale operator itself or your arango cluster (kind: arangodeployments)?

    Anyway, as from this Kubernetes HPA Documentation it says:

    The Horizontal Pod Autoscaler automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization (or, with custom metrics support, on some other application-provided metrics). Note that Horizontal Pod Auto-scaling does not apply to objects that can’t be scaled, for example, DaemonSets.

    It means you can only scale Deployment, ReplicaSet, StatefulSet, or ReplicationController

    In order to autoscale operator itself follow those steps:

    $ kubectl get deploy
    NAME                                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
    arango-deployment-operator               2         2         2            2           19m
    arango-deployment-replication-operator   2         2         2            2           19m
    

    Then autoscale this deployment via: (Modify auto-scale threshold values and change deployment name according to yours)

    $ kubectl autoscale deployment arango-deployment-operator --cpu-percent=10 --min=1 --max=10
    
    horizontalpodautoscaler.autoscaling/arango-deployment-operator autoscaled
    

    If you are looking for auto-scaling ArangoDb cluster, such as dbservers or coordinators, it won't be possible out of the box, because those objects are part of arangodeployments.database.arangodb.com and this crd is not supported by HPA.

    You can scale up and down dbservers and coordinators manually by changing counts in arangodeployment as in mentioned in this Documentation

    Hope it would be useful for you.