From 782ed02e811a308b117f9caeb5ef5fe54f8bbf34 Mon Sep 17 00:00:00 2001 From: tompizmor Date: Thu, 25 Apr 2019 09:59:53 +0200 Subject: [PATCH 1/2] [bitnami/elasticsearch] Adapt chart to Elasticserch version 7 --- bitnami/elasticsearch/Chart.yaml | 4 ++-- ...ter-deploy.yaml => master-statefulset.yaml} | 18 +++++++++++------- bitnami/elasticsearch/values-production.yaml | 2 +- bitnami/elasticsearch/values.yaml | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) rename bitnami/elasticsearch/templates/{master-deploy.yaml => master-statefulset.yaml} (90%) diff --git a/bitnami/elasticsearch/Chart.yaml b/bitnami/elasticsearch/Chart.yaml index 5d9d4e78f..21ebdcbfa 100644 --- a/bitnami/elasticsearch/Chart.yaml +++ b/bitnami/elasticsearch/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: elasticsearch -version: 4.7.2 -appVersion: 6.7.1 +version: 5.0.0 +appVersion: 7.0.0 description: A highly scalable open-source full-text search and analytics engine keywords: - elasticsearch diff --git a/bitnami/elasticsearch/templates/master-deploy.yaml b/bitnami/elasticsearch/templates/master-statefulset.yaml similarity index 90% rename from bitnami/elasticsearch/templates/master-deploy.yaml rename to bitnami/elasticsearch/templates/master-statefulset.yaml index 4573ebe27..0cb1c19e9 100644 --- a/bitnami/elasticsearch/templates/master-deploy.yaml +++ b/bitnami/elasticsearch/templates/master-statefulset.yaml @@ -1,5 +1,5 @@ -apiVersion: extensions/v1beta1 -kind: Deployment +apiVersion: apps/v1beta2 +kind: StatefulSet metadata: name: {{ template "elasticsearch.master.fullname" . }} labels: @@ -12,8 +12,9 @@ spec: selector: matchLabels: app: {{ template "elasticsearch.name" . }} - release: "{{ .Release.Name }}" + release: {{ .Release.Name | quote }} role: "master" + serviceName: "{{ template "elasticsearch.master.fullname" . }}" replicas: {{ .Values.master.replicas }} template: metadata: @@ -52,7 +53,6 @@ spec: {{- if .Values.master.nodeAffinity }} {{ toYaml .Values.master.nodeAffinity | indent 8 }} {{- end }} -{{- include "elasticsearch.imagePullSecrets" . | indent 6 }} {{- if .Values.sysctlImage.enabled }} ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors) initContainers: @@ -66,16 +66,20 @@ spec: containers: - name: "elasticsearch" image: {{ template "elasticsearch.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy | quote }} {{- if .Values.securityContext.enabled }} securityContext: runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} - imagePullPolicy: {{ .Values.image.pullPolicy | quote }} env: - name: ELASTICSEARCH_CLUSTER_NAME value: {{ .Values.name | quote }} - name: ELASTICSEARCH_CLUSTER_HOSTS value: {{ template "elasticsearch.discovery.fullname" . }} + - name: ELASTICSEARCH_CLUSTER_MASTER_HOSTS + {{- $elasticsearchMasterFullname := include "elasticsearch.master.fullname" . }} + {{- $replicas := int .Values.master.replicas }} + value: {{range $i, $e := until $replicas }}{{ $elasticsearchMasterFullname }}-{{ $e }} {{ end }} {{- if .Values.plugins }} - name: ELASTICSEARCH_PLUGINS value: {{ .Values.plugins | quote }} @@ -110,7 +114,7 @@ spec: httpGet: path: /_cluster/health?local=true port: 9200 - {{- end }} + {{- end }} resources: {{ toYaml .Values.master.resources | indent 10 }} volumeMounts: @@ -128,4 +132,4 @@ spec: name: {{ template "elasticsearch.fullname" . }} {{- end }} - name: "data" - emptyDir: {} + emptyDir: {} \ No newline at end of file diff --git a/bitnami/elasticsearch/values-production.yaml b/bitnami/elasticsearch/values-production.yaml index a755ea145..a2ef68abb 100644 --- a/bitnami/elasticsearch/values-production.yaml +++ b/bitnami/elasticsearch/values-production.yaml @@ -13,7 +13,7 @@ image: registry: docker.io repository: bitnami/elasticsearch - tag: 6.7.1 + tag: 7.0.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/bitnami/elasticsearch/values.yaml b/bitnami/elasticsearch/values.yaml index c29fd2498..8228c5ecc 100644 --- a/bitnami/elasticsearch/values.yaml +++ b/bitnami/elasticsearch/values.yaml @@ -13,7 +13,7 @@ image: registry: docker.io repository: bitnami/elasticsearch - tag: 6.7.1 + tag: 7.0.0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images From 5bf68d72155e3fb4509760eeb9c1acff26a3d209 Mon Sep 17 00:00:00 2001 From: tompizmor Date: Fri, 26 Apr 2019 10:11:41 +0200 Subject: [PATCH 2/2] Add imagePullSecrets to all images Signed-off-by: tompizmor --- bitnami/elasticsearch/templates/coordinating-deploy.yaml | 2 +- bitnami/elasticsearch/templates/data-statefulset.yaml | 1 + bitnami/elasticsearch/templates/ingest-deploy.yaml | 1 + bitnami/elasticsearch/templates/master-statefulset.yaml | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bitnami/elasticsearch/templates/coordinating-deploy.yaml b/bitnami/elasticsearch/templates/coordinating-deploy.yaml index 851d623cb..7d2fd48ee 100644 --- a/bitnami/elasticsearch/templates/coordinating-deploy.yaml +++ b/bitnami/elasticsearch/templates/coordinating-deploy.yaml @@ -51,7 +51,7 @@ spec: {{- if .Values.coordinating.nodeAffinity }} {{ toYaml .Values.coordinating.nodeAffinity | indent 8 }} {{- end }} -{{- include "elasticsearch.imagePullSecrets" . | indent 6 }} + {{- include "elasticsearch.imagePullSecrets" . | nindent 6 }} {{- if .Values.sysctlImage.enabled }} ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors) initContainers: diff --git a/bitnami/elasticsearch/templates/data-statefulset.yaml b/bitnami/elasticsearch/templates/data-statefulset.yaml index a7338c5ba..b045b82f7 100644 --- a/bitnami/elasticsearch/templates/data-statefulset.yaml +++ b/bitnami/elasticsearch/templates/data-statefulset.yaml @@ -32,6 +32,7 @@ spec: release: {{ .Release.Name | quote }} role: "data" spec: + {{- include "elasticsearch.imagePullSecrets" . | nindent 6 }} {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }} diff --git a/bitnami/elasticsearch/templates/ingest-deploy.yaml b/bitnami/elasticsearch/templates/ingest-deploy.yaml index a21b6e257..a2665e433 100644 --- a/bitnami/elasticsearch/templates/ingest-deploy.yaml +++ b/bitnami/elasticsearch/templates/ingest-deploy.yaml @@ -23,6 +23,7 @@ spec: release: {{ .Release.Name | quote }} role: "ingest" spec: + {{- include "elasticsearch.imagePullSecrets" . | nindent 6 }} {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }} diff --git a/bitnami/elasticsearch/templates/master-statefulset.yaml b/bitnami/elasticsearch/templates/master-statefulset.yaml index 0cb1c19e9..89d0bc580 100644 --- a/bitnami/elasticsearch/templates/master-statefulset.yaml +++ b/bitnami/elasticsearch/templates/master-statefulset.yaml @@ -14,7 +14,7 @@ spec: app: {{ template "elasticsearch.name" . }} release: {{ .Release.Name | quote }} role: "master" - serviceName: "{{ template "elasticsearch.master.fullname" . }}" + serviceName: {{ template "elasticsearch.master.fullname" . }} replicas: {{ .Values.master.replicas }} template: metadata: @@ -24,6 +24,7 @@ spec: release: {{ .Release.Name | quote }} role: "master" spec: + {{- include "elasticsearch.imagePullSecrets" . | nindent 6 }} {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }}