# How can i stop a cluster on ECK

**URL:** https://discuss.elastic.co/t/how-can-i-stop-a-cluster-on-eck/282974
**Category:** Elastic Cloud on Kubernetes (ECK)
**Created:** [September 1, 2021, 2:30am UTC](https://discuss.elastic.co/t/how-can-i-stop-a-cluster-on-eck/282974 "2021-09-01T02:30:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![w\_Aaron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/w_aaron/32/93982_2.png) [@w\_Aaron](https://discuss.elastic.co/u/w_Aaron)
#### Post date: [September 1, 2021, 2:30am UTC](https://discuss.elastic.co/t/how-can-i-stop-a-cluster-on-eck/282974/1 "2021-09-01T02:30:59Z")

</div>

I changed the cluster yaml file `nodeSet.config.count` value to 0 In my cluster,When i `kubectl describe es xxxx_es_id` ,the logs info is:"es26f861-fa5d-410a-acb1-b9281f6814ae" is invalid: spec.nodeSets: Required value: Elasticsearch needs to have at least one master node。  
How do I skip this limit，pls

---

<div class="post-metadata">

### Author: ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)
#### Post date: [September 1, 2021, 7:02am UTC](https://discuss.elastic.co/t/how-can-i-stop-a-cluster-on-eck/282974/2 "2021-09-01T07:02:25Z")

</div>

What are you trying to achieve? Can you share your YAML manifest maybe. A cluster with 0 nodes is effectively scaled down so you might as well delete the Elasticsearch cluster all together. The only exception to that rule is when you have [autoscaling](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-autoscaling.html) setup in which case we allow zero-sized nodeSets (as the autoscaler will adjust the count)

---

<div class="post-metadata">

### Author: ![w\_Aaron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/w_aaron/32/93982_2.png) [@w\_Aaron](https://discuss.elastic.co/u/w_Aaron)
#### Post date: [September 2, 2021, 12:42pm UTC](https://discuss.elastic.co/t/how-can-i-stop-a-cluster-on-eck/282974/3 "2021-09-02T12:42:00Z")

</div>

Thanks for reply！  
I just want to stop my cluster instead of deleting it, just to temporarily free up resources, next time I can continue to start, but I found that it does not allow me to do so, just like the error mentioned before, I will try you to The scheme, thank you. Following is my yaml file：

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  annotations:
    common.k8s.elastic.co/controller-version: 1.6.0
    elasticsearch.k8s.elastic.co/cluster-uuid: ue9VmPYSSFek_4s04vVq1A
  creationTimestamp: "2021-09-02T11:16:47Z"
  generation: 1
  name: es48fe28-6265-40ef-88db-6657a7380774
  namespace: my-eck-test
  resourceVersion: "23638597"
  selfLink: /apis/elasticsearch.k8s.elastic.co/v1/namespaces/my-eck-test/elasticsearches/es48fe28-6265-40ef-88db-6657a7380774
  uid: 433e306f-0bdf-11ec-95f5-5254f60d511e
spec:
  auth:
    fileRealm:
    - secretName: es48fe28-6265-40ef-88db-6657a7380774
  http:
    service:
      metadata:
        creationTimestamp: null
      spec: {}
    tls:
      certificate: {}
  image: hub.mysite.com/elasticsearch/elasticsearch:7.12.0
  nodeSets:
  - config:
      http.cors.allow-credentials: "true"
      http.cors.allow-headers: X-Requested-With,Content-Type,Content-Length
      http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE
      http.cors.allow-origin: '*'
      http.cors.enabled: "true"
      http.cors.max-age: "1728000"
      http.max_content_length: 100mb
      node.roles:
      - master
      node.store.allow_mmap: false
      transport.tcp.compress: "true"
    count: 3
    name: m-20
    podTemplate:
      metadata:
        creationTimestamp: null
        labels:
          elasticsearch.k8s.elastic.co/pod-role-name: m
      spec:
        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
              - matchExpressions:
                - key: kubernetes.io/hostname
                  operator: NotIn
                  values:
                  - master
        containers:
        - env:
          - name: TZ
            value: Asia/Shanghai
          - name: ES_JAVA_OPTS
            value: -Xms1g -Xmx1g
          lifecycle:
            postStart:
              exec:
                command:
                - bash
                - -c
                - /usr/share/elasticsearch/shell/s3_add_key.sh
          name: elasticsearch
          resources:
            limits:
              cpu: "1"
              memory: 3Gi
          volumeMounts:
          - mountPath: /usr/share/elasticsearch/data
            name: es-data
        initContainers:
        - command:
          - sh
          - -c
          - sysctl -w vm.max_map_count=262144
          name: set-max-map-count
          resources: {}
          securityContext:
            privileged: true
        - command:
          - sh
          - -c
          - bin/elasticsearch-plugin install --batch repository-s3 || true
          name: install-plugins-s3
          resources: {}
    volumeClaimTemplates:
    - metadata:
        creationTimestamp: null
        name: es-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
        storageClassName: managed-nfs-storage
      status: {}
    - metadata:
        creationTimestamp: null
        name: es-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
        storageClassName: managed-nfs-storage
      status: {}
    - metadata:
        creationTimestamp: null
        name: es-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
        storageClassName: managed-nfs-storage
      status: {}
  - config:
      http.cors.allow-credentials: "true"
      http.cors.allow-headers: X-Requested-With,Content-Type,Content-Length
      http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE
      http.cors.allow-origin: '*'
      http.cors.enabled: "true"
      http.cors.max-age: "1728000"
      http.max_content_length: 100mb
      node.roles:
      - data
      node.store.allow_mmap: false
      transport.tcp.compress: "true"
    count: 1
    name: d-20
    podTemplate:
      metadata:
        creationTimestamp: null
        labels:
          elasticsearch.k8s.elastic.co/pod-role-name: d
      spec:
        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
              - matchExpressions:
                - key: kubernetes.io/hostname
                  operator: NotIn
                  values:
                  - master
        containers:
        - env:
          - name: TZ
            value: Asia/Shanghai
          - name: ES_JAVA_OPTS
            value: -Xms1g -Xmx1g
          lifecycle:
            postStart:
              exec:
                command:
                - bash
                - -c
                - /usr/share/elasticsearch/shell/s3_add_key.sh
          name: elasticsearch
          resources:
            limits:
              cpu: "1"
              memory: 3Gi
          volumeMounts:
          - mountPath: /usr/share/elasticsearch/data
            name: es-data
        initContainers:
        - command:
          - sh
          - -c
          - sysctl -w vm.max_map_count=262144
          name: set-max-map-count
          resources: {}
          securityContext:
            privileged: true
        - command:
          - sh
          - -c
          - bin/elasticsearch-plugin install --batch repository-s3 || true
          name: install-plugins-s3
          resources: {}
    volumeClaimTemplates:
    - metadata:
        creationTimestamp: null
        name: es-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
        storageClassName: managed-nfs-storage
      status: {}
  - config:
      http.cors.allow-credentials: "true"
      http.cors.allow-headers: X-Requested-With,Content-Type,Content-Length
      http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE
      http.cors.allow-origin: '*'
      http.cors.enabled: "true"
      http.cors.max-age: "1728000"
      http.max_content_length: 100mb
      node.roles:
      - ingest
      node.store.allow_mmap: false
      transport.tcp.compress: "true"
    count: 1
    name: c-20
    podTemplate:
      metadata:
        creationTimestamp: null
        labels:
          elasticsearch.k8s.elastic.co/pod-role-name: c
      spec:
        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
              - matchExpressions:
                - key: kubernetes.io/hostname
                  operator: NotIn
                  values:
                  - master
        containers:
        - env:
          - name: TZ
            value: Asia/Shanghai
          - name: ES_JAVA_OPTS
            value: -Xms1g -Xmx1g
          lifecycle:
            postStart:
              exec:
                command:
                - bash
                - -c
                - /usr/share/elasticsearch/shell/s3_add_key.sh
          name: elasticsearch
          resources:
            limits:
              cpu: "1"
              memory: 3Gi
          volumeMounts:
          - mountPath: /usr/share/elasticsearch/data
            name: es-data
        initContainers:
        - command:
          - sh
          - -c
          - sysctl -w vm.max_map_count=262144
          name: set-max-map-count
          resources: {}
          securityContext:
            privileged: true
        - command:
          - sh
          - -c
          - bin/elasticsearch-plugin install --batch repository-s3 || true
          name: install-plugins-s3
          resources: {}
    volumeClaimTemplates:
    - metadata:
        creationTimestamp: null
        name: es-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
        storageClassName: managed-nfs-storage
      status: {}
  podDisruptionBudget:
    metadata:
      creationTimestamp: null
    spec: {}
  transport:
    service:
      metadata:
        creationTimestamp: null
      spec: {}
    tls:
      certificate: {}
  updateStrategy:
    changeBudget:
      maxUnavailable: -1
  version: 7.12.0
status:
  availableNodes: 5
  health: green
  phase: Ready
  version: 7.12.0

```

---

<div class="post-metadata">

### Author: ![w\_Aaron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/w_aaron/32/93982_2.png) [@w\_Aaron](https://discuss.elastic.co/u/w_Aaron)
#### Post date: [September 7, 2021, 8:47am UTC](https://discuss.elastic.co/t/how-can-i-stop-a-cluster-on-eck/282974/4 "2021-09-07T08:47:43Z")

</div>

Hi，can you help me？

---

<div class="post-metadata">

### Author: ![dkow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dkow/32/47340_2.png) [@dkow](https://discuss.elastic.co/u/dkow)
#### Post date: [September 8, 2021, 10:12am UTC](https://discuss.elastic.co/t/how-can-i-stop-a-cluster-on-eck/282974/5 "2021-09-08T10:12:02Z")

</div>

Hey @w_Aaron,

as @pebrc mentioned above, we don't allow scaling down to 0. The next best thing you can do is to delete the cluster altogether (eg. `kubectl delete es -n my-eck-test es48fe28-6265-40ef-88db-6657a7380774`).

Let me know if you have any questions.

Thanks,  
David

---

<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: [October 6, 2021, 10:12am UTC](https://discuss.elastic.co/t/how-can-i-stop-a-cluster-on-eck/282974/6 "2021-10-06T10:12:13Z")

</div>

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