diff --git a/bitnami/elasticsearch/README.md b/bitnami/elasticsearch/README.md index 071a78379b..fbb64055b3 100644 --- a/bitnami/elasticsearch/README.md +++ b/bitnami/elasticsearch/README.md @@ -466,6 +466,12 @@ Elasticsearch master nodes store the cluster status at `/bitnami/elasticsearch/d To resolve such issues, PVC's are now attached for master node data persistence. +--- + +Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec. + +In [4dfac075aacf74405e31ae5b27df4369e84eb0b0](https://github.com/bitnami/charts/commit/4dfac075aacf74405e31ae5b27df4369e84eb0b0) the `apiVersion` of the deployment resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage. + ### 7.0.0 This version enabled by default the initContainer that modify some kernel settings to meet the Elasticsearch requirements. More info in the ["Default kernel settings"](#default-kernel-settings) section. diff --git a/bitnami/elasticsearch/templates/_helpers.tpl b/bitnami/elasticsearch/templates/_helpers.tpl index 1d6b8a4a37..f8ef301cc2 100644 --- a/bitnami/elasticsearch/templates/_helpers.tpl +++ b/bitnami/elasticsearch/templates/_helpers.tpl @@ -2,6 +2,29 @@ {{/* Expand the name of the chart. */}} + +{{/* +Return the appropriate apiVersion for statefulset. +*/}} +{{- define "statefulset.apiVersion" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "apps/v1beta1" -}} +{{- else -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for deployment. +*/}} +{{- define "deployment.apiVersion" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "extensions/v1beta1" -}} +{{- else -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} + {{- define "elasticsearch.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/bitnami/elasticsearch/templates/coordinating-deploy.yaml b/bitnami/elasticsearch/templates/coordinating-deploy.yaml index 8d4b9003b5..ae21037977 100644 --- a/bitnami/elasticsearch/templates/coordinating-deploy.yaml +++ b/bitnami/elasticsearch/templates/coordinating-deploy.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: {{ template "deployment.apiVersion" . }} kind: Deployment metadata: name: {{ include "elasticsearch.coordinating.fullname" . }} diff --git a/bitnami/elasticsearch/templates/data-statefulset.yaml b/bitnami/elasticsearch/templates/data-statefulset.yaml index 9ef9ca8a22..0a3e02ca0c 100644 --- a/bitnami/elasticsearch/templates/data-statefulset.yaml +++ b/bitnami/elasticsearch/templates/data-statefulset.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: {{ template "statefulset.apiVersion" . }} kind: StatefulSet metadata: name: {{ include "elasticsearch.data.fullname" . }} diff --git a/bitnami/elasticsearch/templates/ingest-deploy.yaml b/bitnami/elasticsearch/templates/ingest-deploy.yaml index 921a9a3476..7a282a57f8 100644 --- a/bitnami/elasticsearch/templates/ingest-deploy.yaml +++ b/bitnami/elasticsearch/templates/ingest-deploy.yaml @@ -1,5 +1,5 @@ {{- if .Values.ingest.enabled }} -apiVersion: apps/v1 +apiVersion: {{ template "deployment.apiVersion" . }} kind: Deployment metadata: name: {{ include "elasticsearch.ingest.fullname" . }} diff --git a/bitnami/elasticsearch/templates/master-statefulset.yaml b/bitnami/elasticsearch/templates/master-statefulset.yaml index 97c6fe0dca..c7829bc4b0 100644 --- a/bitnami/elasticsearch/templates/master-statefulset.yaml +++ b/bitnami/elasticsearch/templates/master-statefulset.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: {{ template "statefulset.apiVersion" . }} kind: StatefulSet metadata: name: {{ include "elasticsearch.master.fullname" . }} diff --git a/bitnami/elasticsearch/templates/metrics-deploy.yaml b/bitnami/elasticsearch/templates/metrics-deploy.yaml index 66f75531c7..04bbab65b5 100644 --- a/bitnami/elasticsearch/templates/metrics-deploy.yaml +++ b/bitnami/elasticsearch/templates/metrics-deploy.yaml @@ -1,5 +1,5 @@ {{- if .Values.metrics.enabled }} -apiVersion: apps/v1 +apiVersion: {{ template "deployment.apiVersion" . }} kind: Deployment metadata: name: {{ include "elasticsearch.metrics.fullname" . }}