# Kubernetes elasticsearch operator not scaling down

**URL:** <https://discuss.elastic.co/t/kubernetes-elasticsearch-operator-not-scaling-down/183933>\
**Category:** Elasticsearch\
**Created:** [June 3, 2019, 10:19am UTC](https://discuss.elastic.co/t/kubernetes-elasticsearch-operator-not-scaling-down/183933 "2019-06-03T10:19:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vicmarbev](https://avatars.discourse-cdn.com/v4/letter/v/f07891/32.png) [@vicmarbev](https://discuss.elastic.co/u/vicmarbev)\
**Post date:** [June 3, 2019, 10:19am UTC](https://discuss.elastic.co/t/kubernetes-elasticsearch-operator-not-scaling-down/183933/1 "2019-06-03T10:19:04Z")

</div>

Hi,

I'm trying the kubernetes elasticsearch operator, and I have defined an EDS with the following scaling attributes:

```
scaling:
     enabled: true
     minReplicas: 1
     maxReplicas: 4
     minIndexReplicas: 0
     maxIndexReplicas: 2
     minShardsPerNode: 10
     maxShardsPerNode: 20
     scaleUpCPUBoundary: 75
     scaleUpCooldownSeconds: 240
     scaleUpThresholdDurationSeconds: 180
     scaleDownCPUBoundary: 50
     scaleDownCooldownSeconds: 120
     scaleDownThresholdDurationSeconds: 30
     diskUsagePercentScaledownWatermark: 75

```

The cluster starts with one data node, and if I create an index like this:

```
curl -XPUT localhost:9200/demo-index -HContent-type:application/json -d '{"settings": {"index": { "number_of_shards":11, "number_of_replicas":2}}}'

```

The operator creates another node. So far so good. But if I delete the index (thus removing the need for two data nodes), the operator does not scale down automatically. If I modify minimally the EDS yaml and apply it to kubernetes, the operator immediately scales down, so probably I'm missing some configuration here. I thought that the setting was "scaleDownThresholDurationSeconds" but it does not seem to work.

What am I missing here? Is it not supposed to scale down automatically in this case?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 1, 2019, 10:28am UTC](https://discuss.elastic.co/t/kubernetes-elasticsearch-operator-not-scaling-down/183933/2 "2019-07-01T10:28:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
