<p>Would it be possible to use the Kubernetes <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">Horizontal Pod Autoscaler</a> with the <a href="https://docs.arangodb.com/devel/Manual/Deployment/Kubernetes/" rel="nofollow noreferrer">ArangoDB Kubernetes Operator</a>?</p>

Bjorn Thor Jonsson
<p>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: <strong>arangodeployments</strong>)? </p>

<p>Anyway, as from this <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">Kubernetes HPA Documentation</a> it says:</p>

<blockquote>
  <p>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.</p>
</blockquote>

<p>It means you can only scale <strong>Deployment, ReplicaSet, StatefulSet, or ReplicationController</strong></p>

<p><strong>In order to autoscale operator itself follow those steps:</strong></p>

<pre><code>$ 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
</code></pre>

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

<pre><code>$ kubectl autoscale deployment arango-deployment-operator --cpu-percent=10 --min=1 --max=10

horizontalpodautoscaler.autoscaling/arango-deployment-operator autoscaled
</code></pre>

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

<p>You can scale up and down <code>dbservers</code> and <code>coordinators</code> manually by changing counts in <code>arangodeployment</code> as in mentioned in this <a href="https://docs.arangodb.com/3.3/Manual/Deployment/Kubernetes/Scaling.html" rel="nofollow noreferrer">Documentation</a></p>

<p>Hope it would be useful for you.</p>
