0
votes

Is there a way to restart a Elasticsearch cluster without using kubectl delete?

The context is that I have no access to run any cli commands (including kubectl commands), I can only deploy yaml files through kustomize. I now want to install a plugin (ingest-attachment) in the existing container, but it only installs when the container is initialised.

With other kinds of deployments I can set replica:0 then set it back to 1 to imitate a delete and restart, but for kind:Elasticsearch I cannot set nodeSets count to 0, otherwise it throws an error and cannot be deployed.

Is there any possible work around allowing me to install the plugin on the Elasticsearch container?

below is the Elasticsearch yaml file:

apiVersion: elasticsearch.k8s.elastic.co/v1 
kind: Elasticsearch 
metadata: 
  name: elastic-test
spec: 
  version: 7.11.1
  auth:
    roles:
    - secretName: elastic-roles-secret
    fileRealm:
    - secretName: elastic-filerealm-secret
  nodeSets: 
  - name: default
    count: 1 
    config:
      node.store.allow_mmap: false 
    volumeClaimTemplates:
    - metadata:
        name: azure-pvc
      spec:
        storageClassName: ""
        accessModes:
        - ReadWriteMany
        resources:
          requests:
            storage: 25Gi
        volumeName: elasticsearch-azure-pv
    podTemplate:
      spec:
        initContainers:
        - name: install-plugins
          command:
          - sh
          - -c
          - |
            bin/elasticsearch-plugin install --batch ingest-attachment
1
Which version of Kubernetes did you use?kkopczak
client version: v1.20.4, server version: v1.18.10Saligia

1 Answers

0
votes

After searching for solution for your issue, I am sorry to inform that for now restarting cluster without methods you mentioned seems to be impossible.

In this article you can find those methods.

Here you can find custom configuration files and plugins for Elasticsearch.

See also: this and this guide.