<p>I deploy a Elasticsearch cluster to EKS, below is the spec</p>
<pre><code>apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elk
spec:
  version: 7.15.2
  serviceAccountName: docker-sa
  http:
    tls:
      selfSignedCertificate:
        disabled: true
  nodeSets:
  - name: node
    count: 3
    config:
  ...
</code></pre>
<p>I can see it has been deployed correctly and all pods are running.</p>
<pre><code>$ kubectl get pods
NAME                         READY   STATUS    RESTARTS   AGE
elk-es-node-0                1/1     Running   0          19h
elk-es-node-1                1/1     Running   0          19h
elk-es-node-2                1/1     Running   0          11h
</code></pre>
<p>But I can't restart the deployment <code>Elasticsearch</code>,</p>
<pre><code>$ kubectl rollout restart Elasticsearch elk-es-node
Error from server (NotFound): elasticsearches.elasticsearch.k8s.elastic.co &quot;elk-es-node&quot; not found
</code></pre>
<p>The Elasticsearch is using <code>statefulset</code> so I tried to restart <code>statefulset</code>,</p>
<pre><code>$ kubectl rollout restart statefulset elk-es-node
statefulset.apps/elk-es-node restarted
</code></pre>
<p>the above command says <code>restarted</code>, but the actual pods are not restarting.</p>
<p>what is the right way to restart a custom kind in K8S?</p>

Joey Yi Zhao
<p>Use - <em><strong><code>kubectl get all</code></strong></em></p>
<p>To identify if the resource created is a deployment or a statefulset -
use <code>-n &lt;namespace&quot;&gt;</code> along with the above command, if you are working in a specific namespace.</p>
<p>Assuming, you are using a statefulset, the issue below command to understand the properties in which it is configured.</p>
<p><code>kubectl get statefulset &lt;statefulset-name&quot;&gt; -o yaml  &gt; statefulsetContent.yaml</code></p>
<ul>
<li>this will create a yaml file names statefulsetContent.yaml in same directory.</li>
<li>you can use it to explore different options configured in the statefulset.</li>
</ul>
<p>Check for <code>.spec.updateStrategy</code> in the yaml file. Based on this we can identify its update strategy.</p>
<p>Below is from the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies" rel="nofollow noreferrer">official documentation</a></p>
<p>There are two possible values:</p>
<blockquote>
<ul>
<li><strong>OnDelete</strong></li>
</ul>
<p>When a StatefulSet's <code>.spec.updateStrategy.type</code> is set to <code>OnDelete</code>, the StatefulSet controller will not automatically update the Pods in a StatefulSet. Users must manually delete Pods to cause the controller to create new Pods that reflect modifications made to a StatefulSet's <code>.spec.template</code>.</p>
<ul>
<li><strong>RollingUpdate</strong></li>
</ul>
<p>The <code>RollingUpdate</code> update strategy implements automated, rolling update for the Pods in a StatefulSet. This is the default update strategy.</p>
</blockquote>
<p>As a work around, you can try to scale down/up the <code>statefulset</code>.</p>
<p><code>kubectl scale sts &lt;statefulset-name&quot;&gt; --replicas=&lt;count&quot;&gt;</code></p>
