elasticsearch on kubernetes giving me resource not found errors when running guide

5/15/2021

I'm trying to follow this guide: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html and was able to get as far as running curl -u "elastic:$PASSWORD" -k "https://localhost:9200" successfully. However, I tried running it again from step 1 on and am now unable to get past kubectl get pods --selector='elasticsearch.k8s.elastic.co/cluster-name=quickstart' and I get: No resources found in default namespace.

I thought cleaning up all the ECK stuff following this https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-uninstalling-eck.html and restarting would fix the issue, but it doesn't seem to. For example, I have a manifest file that I named elasticsearch.yaml:

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: my-elasticsearch
spec:
  version: 7.12.1
  nodeSets:
    - name: default
      count: 1
      config:
        node.store.allow_mmap: false

and for some reason, I'm seeing this when running kubectl get pods:

my-elasticsearch-depl-6d6f76dd64-4v5q2   0/1     ImagePullBackOff   0          5m40s
my-elasticsearch-depl-7fcfc47f59-sprsv   0/1     ImagePullBackOff   0          11h

When I try deleting either one of them with kubectl delete pod my-elasticsearch-depl-6d6f76dd64-4v5q2, a new one gets automatically generated as well.

I was wondering how to first get rid of these weird zombie pods and then how I might be able to get the basic ECK setup running. Thank you!

-- reactor
elasticsearch
kubernetes

1 Answer

5/16/2021
  1. If you rename metadata.name: quickstart to my-elasticsearch, then you'll need to rename it in kubectl get pods --selector='elasticsearch.k8s.elastic.co/cluster-name=quickstart' as well.
  2. Just deleting a pod won't get rid of it while the operator is still running. Have you really run kubectl delete elastic --all to remove all resources created by the Elastic operator (and if you have been switching around namespaces, in the right namespace(s))?
-- xeraa
Source: StackOverflow