From 64ba2fe169be641d7fa7ef963fd47137a6901979 Mon Sep 17 00:00:00 2001 From: Martin Franz <79975157+mFranz82@users.noreply.github.com> Date: Thu, 1 Jul 2021 19:09:04 +0200 Subject: [PATCH] [bitnami/elasticsearch] Added support for defining a fullnameOverride for individual deployments (#6807) Co-authored-by: Martin Franz --- bitnami/elasticsearch/Chart.yaml | 2 +- bitnami/elasticsearch/README.md | 4 ++++ bitnami/elasticsearch/templates/_helpers.tpl | 19 +++++++++++++++++++ bitnami/elasticsearch/values.yaml | 17 +++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/bitnami/elasticsearch/Chart.yaml b/bitnami/elasticsearch/Chart.yaml index a3dab925e..de2907853 100644 --- a/bitnami/elasticsearch/Chart.yaml +++ b/bitnami/elasticsearch/Chart.yaml @@ -25,4 +25,4 @@ name: elasticsearch sources: - https://github.com/bitnami/bitnami-docker-elasticsearch - https://www.elastic.co/products/elasticsearch -version: 15.8.0 +version: 15.9.0 diff --git a/bitnami/elasticsearch/README.md b/bitnami/elasticsearch/README.md index dbf828340..42291cade 100644 --- a/bitnami/elasticsearch/README.md +++ b/bitnami/elasticsearch/README.md @@ -92,6 +92,7 @@ The following table lists the configurable parameters of the Elasticsearch chart | Parameter | Description | Default | |---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------| | `master.name` | Master-eligible node pod name | `master` | +| `master.fullnameOverride` | String to fully override elasticsearch.master.fullname template with a string | `nil` | | `master.replicas` | Desired number of Elasticsearch master-eligible nodes. Consider using an odd number of master nodes to prevent "split brain" situation. See: https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-discovery-voting.html#_even_numbers_of_master_eligible_nodes | `3` | | `master.updateStrategy.type` | Update strategy for Master statefulset | `RollingUpdate` | | `master.heapSize` | Master-eligible node heap size | `128m` | @@ -158,6 +159,7 @@ The following table lists the configurable parameters of the Elasticsearch chart | Parameter | Description | Default | |---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------| +| `coordinating.fullnameOverride` | String to fully override elasticsearch.coordinating.fullname template with a string | `nil` | | `coordinating.replicas` | Desired number of Elasticsearch coordinating-only nodes | `2` | | `coordinating.hostAliases` | Add deployment host aliases | `[]` | | `coordinating.updateStrategy.type` | Update strategy for Coordinating Deployment | `RollingUpdate` | @@ -217,6 +219,7 @@ The following table lists the configurable parameters of the Elasticsearch chart | Parameter | Description | Default | |---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------| | `data.name` | Data node pod name | `data` | +| `data.fullnameOverride` | String to fully override elasticsearch.data.fullname template with a string | `nil` | | `data.replicas` | Desired number of Elasticsearch data nodes | `2` | | `data.hostAliases` | Add deployment host aliases | `[]` | | `data.updateStrategy.type` | Update strategy for Data statefulset | `RollingUpdate` | @@ -281,6 +284,7 @@ The following table lists the configurable parameters of the Elasticsearch chart |---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------| | `ingest.enabled` | Enable ingest nodes | `false` | | `ingest.name` | Ingest node pod name | `ingest` | +| `ingest.fullnameOverride` | String to fully override elasticsearch.ingest.fullname template with a string | `nil` | | `ingest.replicas` | Desired number of Elasticsearch ingest nodes | `2` | | `ingest.heapSize` | Ingest node heap size | `128m` | | `ingest.hostAliases` | Add deployment host aliases | `[]` | diff --git a/bitnami/elasticsearch/templates/_helpers.tpl b/bitnami/elasticsearch/templates/_helpers.tpl index c76689812..6dfa64a78 100644 --- a/bitnami/elasticsearch/templates/_helpers.tpl +++ b/bitnami/elasticsearch/templates/_helpers.tpl @@ -7,21 +7,30 @@ Return the proper ES image name {{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} {{- end -}} + {{/* Create a default fully qualified master name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "elasticsearch.master.fullname" -}} +{{- if .Values.master.fullnameOverride -}} +{{- .Values.master.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" (include "common.names.fullname" .) .Values.master.name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} {{/* Create a default fully qualified ingest name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "elasticsearch.ingest.fullname" -}} +{{- if .Values.ingest.fullnameOverride -}} +{{- .Values.ingest.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" (include "common.names.fullname" .) .Values.ingest.name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} {{/* Create a default fully qualified coordinating name. @@ -31,9 +40,15 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- if .Values.global.kibanaEnabled -}} {{- printf "%s-%s" .Release.Name .Values.global.coordinating.name | trunc 63 | trimSuffix "-" -}} {{- else -}} +{{- if .Values.coordinating -}} +{{- if .Values.coordinating.fullnameOverride -}} +{{- .Values.coordinating.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" (include "common.names.fullname" .) .Values.global.coordinating.name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} +{{- end -}} +{{- end -}} {{/* Return the hostname of every ElasticSearch seed node @@ -58,8 +73,12 @@ Create a default fully qualified data name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "elasticsearch.data.fullname" -}} +{{- if .Values.data.fullnameOverride -}} +{{- .Values.data.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" (include "common.names.fullname" .) .Values.data.name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} {{ template "elasticsearch.initScriptsSecret" . }} {{/* diff --git a/bitnami/elasticsearch/values.yaml b/bitnami/elasticsearch/values.yaml index 6924ef7f0..2b64f3ddd 100644 --- a/bitnami/elasticsearch/values.yaml +++ b/bitnami/elasticsearch/values.yaml @@ -11,6 +11,7 @@ global: ## coordinating: name: coordinating-only + kibanaEnabled: false ## Bitnami Elasticsearch image version @@ -191,6 +192,10 @@ extraEnvVarsSecret: ## master: name: master + + ## Fully override the deployment name + # fullnameOverride: + ## Number of master-eligible node(s) replicas to deploy. ## "There should normally be an odd number of master-eligible nodes in a cluster" to address "split brain" scenario. ## https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-discovery-voting.html#_even_numbers_of_master_eligible_nodes @@ -421,6 +426,10 @@ master: ## Elasticsearch coordinating-only node parameters ## coordinating: + + ## Fully override the deployment name + # fullnameOverride: + ## Number of coordinating-only node(s) replicas to deploy ## replicas: 2 @@ -607,6 +616,10 @@ coordinating: ## data: name: data + + ## Fully override the deployment name + # fullnameOverride: + ## Number of data node(s) replicas to deploy ## replicas: 2 @@ -812,6 +825,10 @@ data: ingest: enabled: false name: ingest + + ## Fully override the deployment name + # fullnameOverride: + ## Number of ingest node(s) replicas to deploy ## replicas: 2