From 349e5ac559e8b1e48cdd86f028d717aab145fae9 Mon Sep 17 00:00:00 2001 From: Jean-Fabrice Bobo <2949987+jeanfabrice@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:10:17 +0100 Subject: [PATCH 1/4] make plugin installation via initContainer more robust remove plugin before installing it to prevent edge cases where initContainer starts crashing loopback after installation failed --- .../elasticsearch/init-containers-plugin-downloads.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/orchestrating-elastic-stack-applications/elasticsearch/init-containers-plugin-downloads.asciidoc b/docs/orchestrating-elastic-stack-applications/elasticsearch/init-containers-plugin-downloads.asciidoc index 5002f6ddaa..d32d3d277c 100644 --- a/docs/orchestrating-elastic-stack-applications/elasticsearch/init-containers-plugin-downloads.asciidoc +++ b/docs/orchestrating-elastic-stack-applications/elasticsearch/init-containers-plugin-downloads.asciidoc @@ -24,7 +24,7 @@ spec: - sh - -c - | - bin/elasticsearch-plugin install --batch analysis-icu + bin/elasticsearch-plugin remove --purge analysis-icu ; bin/elasticsearch-plugin install --batch analysis-icu ---- You can also override the Elasticsearch container image to use your own image with the plugins already installed, as described in <<{p}-custom-images,custom images>>. For more information on both these options, you can check the <<{p}-snapshots,Create automated snapshots>> section and the Kubernetes documentation on https://kubernetes.io/docs/concepts/workloads/pods/init-containers/[init containers]. From bbe7ab01b817a0ed068b95629cef17aae7721a2b Mon Sep 17 00:00:00 2001 From: jeanfabrice Date: Fri, 10 Nov 2023 15:06:54 +0100 Subject: [PATCH 2/4] Make plugin installation more robust --- deploy/eck-stack/charts/eck-elasticsearch/values.yaml | 8 ++++---- docs/advanced-topics/service-meshes.asciidoc | 1 + .../elasticsearch/bundles-plugins.asciidoc | 5 +++-- .../init-containers-plugin-downloads.asciidoc | 3 ++- .../elasticsearch/snapshots.asciidoc | 5 +---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/deploy/eck-stack/charts/eck-elasticsearch/values.yaml b/deploy/eck-stack/charts/eck-elasticsearch/values.yaml index f537c0e4cb..7e31711042 100644 --- a/deploy/eck-stack/charts/eck-elasticsearch/values.yaml +++ b/deploy/eck-stack/charts/eck-elasticsearch/values.yaml @@ -44,7 +44,7 @@ monitoring: {} # metrics: # elasticsearchRefs: # - name: monitoring - # namespace: observability + # namespace: observability # logs: # elasticsearchRefs: # - name: monitoring @@ -176,7 +176,7 @@ nodeSets: # https://v1-24.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#podtemplatespec-v1-core # # Only the commonly overridden/used fields will be noted below. - # + # spec: # If specified, the pod's scheduling constraints @@ -207,7 +207,7 @@ nodeSets: resources: # Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, # it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. - # + # # Defaults used by the ECK Operator, if not specified, are below limits: # cpu: 1 @@ -267,7 +267,7 @@ nodeSets: # - command: # - sh # - "-c" - # - bin/elasticsearch-plugin install --batch repository-s3 + # - bin/elasticsearch-plugin remove --purge repository-s3 ; bin/elasticsearch-plugin install --batch repository-s3 # name: install-plugins # securityContext: # privileged: true diff --git a/docs/advanced-topics/service-meshes.asciidoc b/docs/advanced-topics/service-meshes.asciidoc index 162d604099..a4a621baa3 100644 --- a/docs/advanced-topics/service-meshes.asciidoc +++ b/docs/advanced-topics/service-meshes.asciidoc @@ -178,6 +178,7 @@ spec: - sh - -c - | + bin/elasticsearch-plugin remove --purge analysis-icu bin/elasticsearch-plugin install --batch analysis-icu ---- diff --git a/docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc b/docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc index e2c00725d0..a52296b7be 100644 --- a/docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc +++ b/docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc @@ -11,7 +11,7 @@ endif::[] To run Elasticsearch with specific plugins or configuration files installed on ECK, you have two options. Each option has its own pros and cons. . Create a custom container image with the required plugins and configuration files. -+ ++ * *Pros* ** Deployment is reproducible and reusable. ** Does not require internet access at runtime. @@ -51,6 +51,7 @@ spec: - sh - -c - | + bin/elasticsearch-plugin remove --purge repository-azure bin/elasticsearch-plugin install --batch repository-azure ---- @@ -106,4 +107,4 @@ spec: set -e bin/elasticsearch-plugin install --batch repository-s3 /bin/tini -- /usr/local/bin/docker-entrypoint.sh ----- \ No newline at end of file +---- diff --git a/docs/orchestrating-elastic-stack-applications/elasticsearch/init-containers-plugin-downloads.asciidoc b/docs/orchestrating-elastic-stack-applications/elasticsearch/init-containers-plugin-downloads.asciidoc index d32d3d277c..fc9ed1b83f 100644 --- a/docs/orchestrating-elastic-stack-applications/elasticsearch/init-containers-plugin-downloads.asciidoc +++ b/docs/orchestrating-elastic-stack-applications/elasticsearch/init-containers-plugin-downloads.asciidoc @@ -24,7 +24,8 @@ spec: - sh - -c - | - bin/elasticsearch-plugin remove --purge analysis-icu ; bin/elasticsearch-plugin install --batch analysis-icu + bin/elasticsearch-plugin remove --purge analysis-icu + bin/elasticsearch-plugin install --batch analysis-icu ---- You can also override the Elasticsearch container image to use your own image with the plugins already installed, as described in <<{p}-custom-images,custom images>>. For more information on both these options, you can check the <<{p}-snapshots,Create automated snapshots>> section and the Kubernetes documentation on https://kubernetes.io/docs/concepts/workloads/pods/init-containers/[init containers]. diff --git a/docs/orchestrating-elastic-stack-applications/elasticsearch/snapshots.asciidoc b/docs/orchestrating-elastic-stack-applications/elasticsearch/snapshots.asciidoc index 687251aa64..953ca7d4e6 100644 --- a/docs/orchestrating-elastic-stack-applications/elasticsearch/snapshots.asciidoc +++ b/docs/orchestrating-elastic-stack-applications/elasticsearch/snapshots.asciidoc @@ -429,6 +429,7 @@ spec: - sh - -c - | + bin/elasticsearch-plugin remove --purge repository-gcs bin/elasticsearch-plugin install --batch repository-gcs ---- @@ -438,7 +439,3 @@ Assuming you stored this in a file called `elasticsearch.yaml` you can in both c ---- kubectl apply -f elasticsearch.yaml ---- - - - - From 82a6f75b9e2b7db5c6fde3b180d5cae9b68bc8b2 Mon Sep 17 00:00:00 2001 From: Jean-Fabrice Bobo <2949987+jeanfabrice@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:36:58 +0100 Subject: [PATCH 3/4] Update deploy/eck-stack/charts/eck-elasticsearch/values.yaml Co-authored-by: Thibault Richard --- deploy/eck-stack/charts/eck-elasticsearch/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/eck-stack/charts/eck-elasticsearch/values.yaml b/deploy/eck-stack/charts/eck-elasticsearch/values.yaml index 7e31711042..db647a3a53 100644 --- a/deploy/eck-stack/charts/eck-elasticsearch/values.yaml +++ b/deploy/eck-stack/charts/eck-elasticsearch/values.yaml @@ -267,7 +267,7 @@ nodeSets: # - command: # - sh # - "-c" - # - bin/elasticsearch-plugin remove --purge repository-s3 ; bin/elasticsearch-plugin install --batch repository-s3 + # - bin/elasticsearch-plugin remove --purge analysis-icu ; bin/elasticsearch-plugin install --batch analysis-icu # name: install-plugins # securityContext: # privileged: true From 4d7d116fc3d1f76fd7496605aa1d0a3348ac9715 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Mon, 13 Nov 2023 17:13:47 +0100 Subject: [PATCH 4/4] Update docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc Co-authored-by: Jean-Fabrice Bobo <2949987+jeanfabrice@users.noreply.github.com> --- .../elasticsearch/bundles-plugins.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc b/docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc index a52296b7be..397438a845 100644 --- a/docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc +++ b/docs/orchestrating-elastic-stack-applications/elasticsearch/bundles-plugins.asciidoc @@ -105,6 +105,7 @@ spec: - | #!/usr/bin/env bash set -e + bin/elasticsearch-plugin remove --purge repository-s3 || true bin/elasticsearch-plugin install --batch repository-s3 /bin/tini -- /usr/local/bin/docker-entrypoint.sh ----