@leverege/build-tools 2.50.2 → 2.50.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package.json +3 -3
  2. package/registry-compass.yaml +20 -0
  3. package/src/chart-compass.mjs +96 -0
  4. package/src/helm-charts/cnpg-db-psql-stack/cluster.yaml.ovh +1 -1
  5. package/src/helm-charts/cnpg-db-psql-stack/gitignore +1 -1
  6. package/src/helm-charts/cnpg-db-psql-stack/helmdn.plugin +1 -1
  7. package/src/helm-charts/cnpg-db-tsdb-basic/cluster.yaml.ovh +1 -1
  8. package/src/helm-charts/cnpg-db-tsdb-basic/gitignore +1 -1
  9. package/src/helm-charts/cnpg-db-tsdb-basic/helmdn.plugin +1 -1
  10. package/src/helm-charts/cnpg-db-tsdb-dense/{cluster.yalm.ovh → cluster.yaml.ovh} +1 -1
  11. package/src/helm-charts/cnpg-db-tsdb-dense/gitignore +1 -1
  12. package/src/helm-charts/cnpg-db-tsdb-dense/helmdn.plugin +1 -1
  13. package/src/helm-charts/elasticsearch8/helmup.plugin +5 -0
  14. package/src/helm-charts/redis/helmup.plugin +1 -1
  15. package/src/helm-charts/stackdriver-exporter/values-local.yaml +21 -0
  16. package/src/helm-charts/traefik/helmup.plugin +9 -2
  17. package/src/helm-charts/traefik/traefik-local.yaml +6 -0
  18. package/src/helm-charts/velero/velero-local.yaml +10 -0
  19. package/src/zx-testing +216 -0
  20. package/src/helm-charts/elasticsearch-helm-gke1.25/.helmignore +0 -2
  21. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/Chart.yaml +0 -12
  22. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/Makefile +0 -1
  23. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/README.md +0 -1
  24. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/NOTES.txt +0 -6
  25. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/_helpers.tpl +0 -65
  26. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/configmap.yaml +0 -34
  27. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/ingress.yaml +0 -64
  28. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/networkpolicy.yaml +0 -61
  29. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/poddisruptionbudget.yaml +0 -12
  30. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/podsecuritypolicy.yaml +0 -14
  31. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/role.yaml +0 -25
  32. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/rolebinding.yaml +0 -24
  33. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/service.yaml +0 -76
  34. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/serviceaccount.yaml +0 -20
  35. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/statefulset.yaml +0 -390
  36. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/values.yaml +0 -352
@@ -1,64 +0,0 @@
1
- {{- if .Values.ingress.enabled -}}
2
- {{- $fullName := include "elasticsearch.uname" . -}}
3
- {{- $httpPort := .Values.httpPort -}}
4
- {{- $pathtype := .Values.ingress.pathtype -}}
5
- {{- $ingressPath := .Values.ingress.path -}}
6
- apiVersion: networking.k8s.io/v1
7
- kind: Ingress
8
- metadata:
9
- name: {{ $fullName }}
10
- labels:
11
- app: {{ .Chart.Name }}
12
- release: {{ .Release.Name }}
13
- heritage: {{ .Release.Service }}
14
- {{- with .Values.ingress.annotations }}
15
- annotations:
16
- {{ toYaml . | indent 4 }}
17
- {{- end }}
18
- spec:
19
- {{- if .Values.ingress.className }}
20
- ingressClassName: {{ .Values.ingress.className | quote }}
21
- {{- end }}
22
- {{- if .Values.ingress.tls }}
23
- tls:
24
- {{- if .ingressPath }}
25
- {{- range .Values.ingress.tls }}
26
- - hosts:
27
- {{- range .hosts }}
28
- - {{ . }}
29
- {{- end }}
30
- secretName: {{ .secretName }}
31
- {{- end }}
32
- {{- else }}
33
- {{ toYaml .Values.ingress.tls | indent 4 }}
34
- {{- end }}
35
- {{- end}}
36
- rules:
37
- {{- range .Values.ingress.hosts }}
38
- {{- if $ingressPath }}
39
- - host: {{ . }}
40
- http:
41
- paths:
42
- - path: {{ $ingressPath }}
43
- pathType: {{ $pathtype }}
44
- backend:
45
- service:
46
- name: {{ $fullName }}
47
- port:
48
- number: {{ $httpPort }}
49
- {{- else }}
50
- - host: {{ .host }}
51
- http:
52
- paths:
53
- {{- range .paths }}
54
- - path: {{ .path }}
55
- pathType: {{ $pathtype }}
56
- backend:
57
- service:
58
- name: {{ $fullName }}
59
- port:
60
- number: {{ .servicePort | default $httpPort }}
61
- {{- end }}
62
- {{- end }}
63
- {{- end }}
64
- {{- end }}
@@ -1,61 +0,0 @@
1
- {{- if (or .Values.networkPolicy.http.enabled .Values.networkPolicy.transport.enabled) }}
2
- kind: NetworkPolicy
3
- apiVersion: networking.k8s.io/v1
4
- metadata:
5
- name: {{ template "elasticsearch.uname" . }}
6
- labels:
7
- heritage: {{ .Release.Service | quote }}
8
- release: {{ .Release.Name | quote }}
9
- chart: "{{ .Chart.Name }}"
10
- app: "{{ template "elasticsearch.uname" . }}"
11
- spec:
12
- podSelector:
13
- matchLabels:
14
- app: "{{ template "elasticsearch.uname" . }}"
15
- ingress: # Allow inbound connections
16
-
17
- {{- if .Values.networkPolicy.http.enabled }}
18
- # For HTTP access
19
- - ports:
20
- - port: {{ .Values.httpPort }}
21
- from:
22
- # From authorized Pods (having the correct label)
23
- - podSelector:
24
- matchLabels:
25
- {{ template "elasticsearch.uname" . }}-http-client: "true"
26
- {{- with .Values.networkPolicy.http.explicitNamespacesSelector }}
27
- # From authorized namespaces
28
- namespaceSelector:
29
- {{ toYaml . | indent 12 }}
30
- {{- end }}
31
- {{- with .Values.networkPolicy.http.additionalRules }}
32
- # Or from custom additional rules
33
- {{ toYaml . | indent 8 }}
34
- {{- end }}
35
- {{- end }}
36
-
37
- {{- if .Values.networkPolicy.transport.enabled }}
38
- # For transport access
39
- - ports:
40
- - port: {{ .Values.transportPort }}
41
- from:
42
- # From authorized Pods (having the correct label)
43
- - podSelector:
44
- matchLabels:
45
- {{ template "elasticsearch.uname" . }}-transport-client: "true"
46
- {{- with .Values.networkPolicy.transport.explicitNamespacesSelector }}
47
- # From authorized namespaces
48
- namespaceSelector:
49
- {{ toYaml . | indent 12 }}
50
- {{- end }}
51
- {{- with .Values.networkPolicy.transport.additionalRules }}
52
- # Or from custom additional rules
53
- {{ toYaml . | indent 8 }}
54
- {{- end }}
55
- # Or from other ElasticSearch Pods
56
- - podSelector:
57
- matchLabels:
58
- app: "{{ template "elasticsearch.uname" . }}"
59
- {{- end }}
60
-
61
- {{- end }}
@@ -1,12 +0,0 @@
1
- ---
2
- {{- if .Values.maxUnavailable }}
3
- apiVersion: policy/v1
4
- kind: PodDisruptionBudget
5
- metadata:
6
- name: "{{ template "elasticsearch.uname" . }}-pdb"
7
- spec:
8
- maxUnavailable: {{ .Values.maxUnavailable }}
9
- selector:
10
- matchLabels:
11
- app: "{{ template "elasticsearch.uname" . }}"
12
- {{- end }}
@@ -1,14 +0,0 @@
1
- {{- if .Values.podSecurityPolicy.create -}}
2
- {{- $fullName := include "elasticsearch.uname" . -}}
3
- apiVersion: policy/v1beta1
4
- kind: PodSecurityPolicy
5
- metadata:
6
- name: {{ default $fullName .Values.podSecurityPolicy.name | quote }}
7
- labels:
8
- heritage: {{ .Release.Service | quote }}
9
- release: {{ .Release.Name | quote }}
10
- chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11
- app: {{ $fullName | quote }}
12
- spec:
13
- {{ toYaml .Values.podSecurityPolicy.spec | indent 2 }}
14
- {{- end -}}
@@ -1,25 +0,0 @@
1
- {{- if .Values.rbac.create -}}
2
- {{- $fullName := include "elasticsearch.uname" . -}}
3
- apiVersion: rbac.authorization.k8s.io/v1
4
- kind: Role
5
- metadata:
6
- name: {{ $fullName | quote }}
7
- labels:
8
- heritage: {{ .Release.Service | quote }}
9
- release: {{ .Release.Name | quote }}
10
- chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11
- app: {{ $fullName | quote }}
12
- rules:
13
- - apiGroups:
14
- - extensions
15
- resources:
16
- - podsecuritypolicies
17
- resourceNames:
18
- {{- if eq .Values.podSecurityPolicy.name "" }}
19
- - {{ $fullName | quote }}
20
- {{- else }}
21
- - {{ .Values.podSecurityPolicy.name | quote }}
22
- {{- end }}
23
- verbs:
24
- - use
25
- {{- end -}}
@@ -1,24 +0,0 @@
1
- {{- if .Values.rbac.create -}}
2
- {{- $fullName := include "elasticsearch.uname" . -}}
3
- apiVersion: rbac.authorization.k8s.io/v1
4
- kind: RoleBinding
5
- metadata:
6
- name: {{ $fullName | quote }}
7
- labels:
8
- heritage: {{ .Release.Service | quote }}
9
- release: {{ .Release.Name | quote }}
10
- chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11
- app: {{ $fullName | quote }}
12
- subjects:
13
- - kind: ServiceAccount
14
- {{- if eq .Values.rbac.serviceAccountName "" }}
15
- name: {{ $fullName | quote }}
16
- {{- else }}
17
- name: {{ .Values.rbac.serviceAccountName | quote }}
18
- {{- end }}
19
- namespace: {{ .Release.Namespace | quote }}
20
- roleRef:
21
- kind: Role
22
- name: {{ $fullName | quote }}
23
- apiGroup: rbac.authorization.k8s.io
24
- {{- end -}}
@@ -1,76 +0,0 @@
1
- {{- if .Values.service.enabled -}}
2
- kind: Service
3
- apiVersion: v1
4
- metadata:
5
- {{- if eq .Values.nodeGroup "master" }}
6
- name: {{ template "elasticsearch.masterService" . }}
7
- {{- else }}
8
- name: {{ template "elasticsearch.uname" . }}
9
- {{- end }}
10
- labels:
11
- heritage: {{ .Release.Service | quote }}
12
- release: {{ .Release.Name | quote }}
13
- chart: "{{ .Chart.Name }}"
14
- app: "{{ template "elasticsearch.uname" . }}"
15
- {{- if .Values.service.labels }}
16
- {{ toYaml .Values.service.labels | indent 4}}
17
- {{- end }}
18
- annotations:
19
- {{ toYaml .Values.service.annotations | indent 4 }}
20
- spec:
21
- type: {{ .Values.service.type }}
22
- selector:
23
- release: {{ .Release.Name | quote }}
24
- chart: "{{ .Chart.Name }}"
25
- app: "{{ template "elasticsearch.uname" . }}"
26
- ports:
27
- - name: {{ .Values.service.httpPortName | default "http" }}
28
- protocol: TCP
29
- port: {{ .Values.httpPort }}
30
- {{- if .Values.service.nodePort }}
31
- nodePort: {{ .Values.service.nodePort }}
32
- {{- end }}
33
- - name: {{ .Values.service.transportPortName | default "transport" }}
34
- protocol: TCP
35
- port: {{ .Values.transportPort }}
36
- {{- if .Values.service.loadBalancerIP }}
37
- loadBalancerIP: {{ .Values.service.loadBalancerIP }}
38
- {{- end }}
39
- {{- with .Values.service.loadBalancerSourceRanges }}
40
- loadBalancerSourceRanges:
41
- {{ toYaml . | indent 4 }}
42
- {{- end }}
43
- {{- if .Values.service.externalTrafficPolicy }}
44
- externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
45
- {{- end }}
46
- {{- end }}
47
- ---
48
- kind: Service
49
- apiVersion: v1
50
- metadata:
51
- {{- if eq .Values.nodeGroup "master" }}
52
- name: {{ template "elasticsearch.masterService" . }}-headless
53
- {{- else }}
54
- name: {{ template "elasticsearch.uname" . }}-headless
55
- {{- end }}
56
- labels:
57
- heritage: {{ .Release.Service | quote }}
58
- release: {{ .Release.Name | quote }}
59
- chart: "{{ .Chart.Name }}"
60
- app: "{{ template "elasticsearch.uname" . }}"
61
- {{- if .Values.service.labelsHeadless }}
62
- {{ toYaml .Values.service.labelsHeadless | indent 4 }}
63
- {{- end }}
64
- annotations:
65
- service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
66
- spec:
67
- clusterIP: None # This is needed for statefulset hostnames like elasticsearch-0 to resolve
68
- # Create endpoints also if the related pod isn't ready
69
- publishNotReadyAddresses: true
70
- selector:
71
- app: "{{ template "elasticsearch.uname" . }}"
72
- ports:
73
- - name: {{ .Values.service.httpPortName | default "http" }}
74
- port: {{ .Values.httpPort }}
75
- - name: {{ .Values.service.transportPortName | default "transport" }}
76
- port: {{ .Values.transportPort }}
@@ -1,20 +0,0 @@
1
- {{- if .Values.rbac.create -}}
2
- {{- $fullName := include "elasticsearch.uname" . -}}
3
- apiVersion: v1
4
- kind: ServiceAccount
5
- metadata:
6
- {{- if eq .Values.rbac.serviceAccountName "" }}
7
- name: {{ $fullName | quote }}
8
- {{- else }}
9
- name: {{ .Values.rbac.serviceAccountName | quote }}
10
- {{- end }}
11
- annotations:
12
- {{- with .Values.rbac.serviceAccountAnnotations }}
13
- {{- toYaml . | nindent 4 }}
14
- {{- end }}
15
- labels:
16
- heritage: {{ .Release.Service | quote }}
17
- release: {{ .Release.Name | quote }}
18
- chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
19
- app: {{ $fullName | quote }}
20
- {{- end -}}
@@ -1,390 +0,0 @@
1
- ---
2
- apiVersion: apps/v1
3
- kind: StatefulSet
4
- metadata:
5
- name: {{ template "elasticsearch.uname" . }}
6
- labels:
7
- heritage: {{ .Release.Service | quote }}
8
- release: {{ .Release.Name | quote }}
9
- chart: "{{ .Chart.Name }}"
10
- app: "{{ template "elasticsearch.uname" . }}"
11
- {{- range $key, $value := .Values.labels }}
12
- {{ $key }}: {{ $value | quote }}
13
- {{- end }}
14
- annotations:
15
- esMajorVersion: "{{ include "elasticsearch.esMajorVersion" . }}"
16
- spec:
17
- serviceName: {{ template "elasticsearch.uname" . }}-headless
18
- selector:
19
- matchLabels:
20
- app: "{{ template "elasticsearch.uname" . }}"
21
- replicas: {{ .Values.replicas }}
22
- podManagementPolicy: {{ .Values.podManagementPolicy }}
23
- updateStrategy:
24
- type: {{ .Values.updateStrategy }}
25
- {{- if .Values.persistence.enabled }}
26
- volumeClaimTemplates:
27
- - metadata:
28
- name: {{ template "elasticsearch.uname" . }}
29
- {{- if .Values.persistence.labels.enabled }}
30
- labels:
31
- release: {{ .Release.Name | quote }}
32
- chart: "{{ .Chart.Name }}"
33
- app: "{{ template "elasticsearch.uname" . }}"
34
- {{- range $key, $value := .Values.labels }}
35
- {{ $key }}: {{ $value | quote }}
36
- {{- end }}
37
- {{- end }}
38
- {{- with .Values.persistence.annotations }}
39
- annotations:
40
- {{ toYaml . | indent 8 }}
41
- {{- end }}
42
- spec:
43
- {{ toYaml .Values.volumeClaimTemplate | indent 6 }}
44
- {{- end }}
45
- template:
46
- metadata:
47
- name: "{{ template "elasticsearch.uname" . }}"
48
- labels:
49
- release: {{ .Release.Name | quote }}
50
- chart: "{{ .Chart.Name }}"
51
- app: "{{ template "elasticsearch.uname" . }}"
52
- {{- range $key, $value := .Values.labels }}
53
- {{ $key }}: {{ $value | quote }}
54
- {{- end }}
55
- annotations:
56
- {{- range $key, $value := .Values.podAnnotations }}
57
- {{ $key }}: {{ $value | quote }}
58
- {{- end }}
59
- {{/* This forces a restart if the configmap has changed */}}
60
- {{- if or .Values.esConfig .Values.esJvmOptions }}
61
- configchecksum: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63 }}
62
- {{- end }}
63
- spec:
64
- {{- if .Values.schedulerName }}
65
- schedulerName: "{{ .Values.schedulerName }}"
66
- {{- end }}
67
- securityContext:
68
- {{ toYaml .Values.podSecurityContext | indent 8 }}
69
- {{- if .Values.fsGroup }}
70
- fsGroup: {{ .Values.fsGroup }} # Deprecated value, please use .Values.podSecurityContext.fsGroup
71
- {{- end }}
72
- {{- if .Values.rbac.create }}
73
- serviceAccountName: "{{ template "elasticsearch.uname" . }}"
74
- {{- else if not (eq .Values.rbac.serviceAccountName "") }}
75
- serviceAccountName: {{ .Values.rbac.serviceAccountName | quote }}
76
- {{- end }}
77
- automountServiceAccountToken: {{ .Values.rbac.automountToken }}
78
- {{- with .Values.tolerations }}
79
- tolerations:
80
- {{ toYaml . | indent 6 }}
81
- {{- end }}
82
- {{- with .Values.nodeSelector }}
83
- nodeSelector:
84
- {{ toYaml . | indent 8 }}
85
- {{- end }}
86
- {{- if or (eq .Values.antiAffinity "hard") (eq .Values.antiAffinity "soft") .Values.nodeAffinity }}
87
- {{- if .Values.priorityClassName }}
88
- priorityClassName: {{ .Values.priorityClassName }}
89
- {{- end }}
90
- affinity:
91
- {{- end }}
92
- {{- if eq .Values.antiAffinity "hard" }}
93
- podAntiAffinity:
94
- requiredDuringSchedulingIgnoredDuringExecution:
95
- - labelSelector:
96
- matchExpressions:
97
- - key: app
98
- operator: In
99
- values:
100
- - "{{ template "elasticsearch.uname" .}}"
101
- topologyKey: {{ .Values.antiAffinityTopologyKey }}
102
- {{- else if eq .Values.antiAffinity "soft" }}
103
- podAntiAffinity:
104
- preferredDuringSchedulingIgnoredDuringExecution:
105
- - weight: 1
106
- podAffinityTerm:
107
- topologyKey: {{ .Values.antiAffinityTopologyKey }}
108
- labelSelector:
109
- matchExpressions:
110
- - key: app
111
- operator: In
112
- values:
113
- - "{{ template "elasticsearch.uname" . }}"
114
- {{- end }}
115
- {{- with .Values.nodeAffinity }}
116
- nodeAffinity:
117
- {{ toYaml . | indent 10 }}
118
- {{- end }}
119
- terminationGracePeriodSeconds: {{ .Values.terminationGracePeriod }}
120
- volumes:
121
- {{- range .Values.secretMounts }}
122
- - name: {{ .name }}
123
- secret:
124
- secretName: {{ .secretName }}
125
- {{- if .defaultMode }}
126
- defaultMode: {{ .defaultMode }}
127
- {{- end }}
128
- {{- end }}
129
- {{- if .Values.esConfig }}
130
- - name: esconfig
131
- configMap:
132
- name: {{ template "elasticsearch.uname" . }}-config
133
- {{- end }}
134
- {{- if .Values.esJvmOptions }}
135
- - name: esjvmoptions
136
- configMap:
137
- name: {{ template "elasticsearch.uname" . }}-jvm-options
138
- {{- end }}
139
- {{- if .Values.keystore }}
140
- - name: keystore
141
- emptyDir: {}
142
- {{- range .Values.keystore }}
143
- - name: keystore-{{ .secretName }}
144
- secret: {{ toYaml . | nindent 12 }}
145
- {{- end }}
146
- {{ end }}
147
- {{- if .Values.extraVolumes }}
148
- # Currently some extra blocks accept strings
149
- # to continue with backwards compatibility this is being kept
150
- # whilst also allowing for yaml to be specified too.
151
- {{- if eq "string" (printf "%T" .Values.extraVolumes) }}
152
- {{ tpl .Values.extraVolumes . | indent 8 }}
153
- {{- else }}
154
- {{ toYaml .Values.extraVolumes | indent 8 }}
155
- {{- end }}
156
- {{- end }}
157
- {{- if .Values.imagePullSecrets }}
158
- imagePullSecrets:
159
- {{ toYaml .Values.imagePullSecrets | indent 8 }}
160
- {{- end }}
161
- enableServiceLinks: {{ .Values.enableServiceLinks }}
162
- {{- if .Values.hostAliases }}
163
- hostAliases: {{ toYaml .Values.hostAliases | nindent 8 }}
164
- {{- end }}
165
- {{- if or (.Values.extraInitContainers) (.Values.sysctlInitContainer.enabled) (.Values.keystore) }}
166
- initContainers:
167
- {{- if .Values.sysctlInitContainer.enabled }}
168
- - name: configure-sysctl
169
- securityContext:
170
- runAsUser: 0
171
- privileged: true
172
- image: "{{ .Values.image }}:{{ .Values.imageTag }}"
173
- imagePullPolicy: "{{ .Values.imagePullPolicy }}"
174
- command: ["sysctl", "-w", "vm.max_map_count={{ .Values.sysctlVmMaxMapCount}}"]
175
- resources:
176
- {{ toYaml .Values.initResources | indent 10 }}
177
- {{- end }}
178
- {{ if .Values.keystore }}
179
- - name: keystore
180
- image: "{{ .Values.image }}:{{ .Values.imageTag }}"
181
- imagePullPolicy: "{{ .Values.imagePullPolicy }}"
182
- command:
183
- - bash
184
- - -c
185
- - |
186
- set -euo pipefail
187
-
188
- elasticsearch-keystore create
189
-
190
- for i in /tmp/keystoreSecrets/*/*; do
191
- key=$(basename $i)
192
- echo "Adding file $i to keystore key $key"
193
- elasticsearch-keystore add-file "$key" "$i"
194
- done
195
-
196
- # Add the bootstrap password since otherwise the Elasticsearch entrypoint tries to do this on startup
197
- if [ ! -z ${ELASTIC_PASSWORD+x} ]; then
198
- echo 'Adding env $ELASTIC_PASSWORD to keystore as key bootstrap.password'
199
- echo "$ELASTIC_PASSWORD" | elasticsearch-keystore add -x bootstrap.password
200
- fi
201
-
202
- cp -a /usr/share/elasticsearch/config/elasticsearch.keystore /tmp/keystore/
203
- env: {{ toYaml .Values.extraEnvs | nindent 10 }}
204
- envFrom: {{ toYaml .Values.envFrom | nindent 10 }}
205
- resources: {{ toYaml .Values.initResources | nindent 10 }}
206
- volumeMounts:
207
- - name: keystore
208
- mountPath: /tmp/keystore
209
- {{- range .Values.keystore }}
210
- - name: keystore-{{ .secretName }}
211
- mountPath: /tmp/keystoreSecrets/{{ .secretName }}
212
- {{- end }}
213
- {{ end }}
214
- {{- if .Values.extraInitContainers }}
215
- # Currently some extra blocks accept strings
216
- # to continue with backwards compatibility this is being kept
217
- # whilst also allowing for yaml to be specified too.
218
- {{- if eq "string" (printf "%T" .Values.extraInitContainers) }}
219
- {{ tpl .Values.extraInitContainers . | indent 6 }}
220
- {{- else }}
221
- {{ toYaml .Values.extraInitContainers | indent 6 }}
222
- {{- end }}
223
- {{- end }}
224
- {{- end }}
225
- containers:
226
- - name: "{{ template "elasticsearch.name" . }}"
227
- securityContext:
228
- {{ toYaml .Values.securityContext | indent 10 }}
229
- image: "{{ .Values.image }}:{{ .Values.imageTag }}"
230
- imagePullPolicy: "{{ .Values.imagePullPolicy }}"
231
- readinessProbe:
232
- exec:
233
- command:
234
- - bash
235
- - -c
236
- - |
237
- set -e
238
- # If the node is starting up wait for the cluster to be ready (request params: "{{ .Values.clusterHealthCheckParams }}" )
239
- # Once it has started only check that the node itself is responding
240
- START_FILE=/tmp/.es_start_file
241
-
242
- # Disable nss cache to avoid filling dentry cache when calling curl
243
- # This is required with Elasticsearch Docker using nss < 3.52
244
- export NSS_SDB_USE_CACHE=no
245
-
246
- http () {
247
- local path="${1}"
248
- local args="${2}"
249
- set -- -XGET -s
250
-
251
- if [ "$args" != "" ]; then
252
- set -- "$@" $args
253
- fi
254
-
255
- if [ -n "${ELASTIC_PASSWORD}" ]; then
256
- set -- "$@" -u "elastic:${ELASTIC_PASSWORD}"
257
- fi
258
-
259
- curl --output /dev/null -k "$@" "{{ .Values.protocol }}://127.0.0.1:{{ .Values.httpPort }}${path}"
260
- }
261
-
262
- if [ -f "${START_FILE}" ]; then
263
- echo 'Elasticsearch is already running, lets check the node is healthy'
264
- HTTP_CODE=$(http "/" "-w %{http_code}")
265
- RC=$?
266
- if [[ ${RC} -ne 0 ]]; then
267
- echo "curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} {{ .Values.protocol }}://127.0.0.1:{{ .Values.httpPort }}/ failed with RC ${RC}"
268
- exit ${RC}
269
- fi
270
- # ready if HTTP code 200, 503 is tolerable if ES version is 6.x
271
- if [[ ${HTTP_CODE} == "200" ]]; then
272
- exit 0
273
- elif [[ ${HTTP_CODE} == "503" && "{{ include "elasticsearch.esMajorVersion" . }}" == "6" ]]; then
274
- exit 0
275
- else
276
- echo "curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} {{ .Values.protocol }}://127.0.0.1:{{ .Values.httpPort }}/ failed with HTTP code ${HTTP_CODE}"
277
- exit 1
278
- fi
279
-
280
- else
281
- echo 'Waiting for elasticsearch cluster to become ready (request params: "{{ .Values.clusterHealthCheckParams }}" )'
282
- if http "/_cluster/health?{{ .Values.clusterHealthCheckParams }}" "--fail" ; then
283
- touch ${START_FILE}
284
- exit 0
285
- else
286
- echo 'Cluster is not yet ready (request params: "{{ .Values.clusterHealthCheckParams }}" )'
287
- exit 1
288
- fi
289
- fi
290
- {{ toYaml .Values.readinessProbe | indent 10 }}
291
- ports:
292
- - name: http
293
- containerPort: {{ .Values.httpPort }}
294
- - name: transport
295
- containerPort: {{ .Values.transportPort }}
296
- resources:
297
- {{ toYaml .Values.resources | indent 10 }}
298
- env:
299
- - name: node.name
300
- valueFrom:
301
- fieldRef:
302
- fieldPath: metadata.name
303
- {{- if eq .Values.roles.master "true" }}
304
- {{- if ge (int (include "elasticsearch.esMajorVersion" .)) 7 }}
305
- - name: cluster.initial_master_nodes
306
- value: "{{ template "elasticsearch.endpoints" . }}"
307
- {{- else }}
308
- - name: discovery.zen.minimum_master_nodes
309
- value: "{{ .Values.minimumMasterNodes }}"
310
- {{- end }}
311
- {{- end }}
312
- {{- if lt (int (include "elasticsearch.esMajorVersion" .)) 7 }}
313
- - name: discovery.zen.ping.unicast.hosts
314
- value: "{{ template "elasticsearch.masterService" . }}-headless"
315
- {{- else }}
316
- - name: discovery.seed_hosts
317
- value: "{{ template "elasticsearch.masterService" . }}-headless"
318
- {{- end }}
319
- - name: cluster.name
320
- value: "{{ .Values.clusterName }}"
321
- - name: network.host
322
- value: "{{ .Values.networkHost }}"
323
- - name: cluster.deprecation_indexing.enabled
324
- value: "{{ .Values.clusterDeprecationIndexing }}"
325
- {{- if .Values.esJavaOpts }}
326
- - name: ES_JAVA_OPTS
327
- value: "{{ .Values.esJavaOpts }}"
328
- {{- end }}
329
- {{- range $role, $enabled := .Values.roles }}
330
- - name: node.{{ $role }}
331
- value: "{{ $enabled }}"
332
- {{- end }}
333
- {{- if .Values.extraEnvs }}
334
- {{ toYaml .Values.extraEnvs | indent 10 }}
335
- {{- end }}
336
- {{- if .Values.envFrom }}
337
- envFrom:
338
- {{ toYaml .Values.envFrom | indent 10 }}
339
- {{- end }}
340
- volumeMounts:
341
- {{- if .Values.persistence.enabled }}
342
- - name: "{{ template "elasticsearch.uname" . }}"
343
- mountPath: /usr/share/elasticsearch/data
344
- {{- end }}
345
- {{ if .Values.keystore }}
346
- - name: keystore
347
- mountPath: /usr/share/elasticsearch/config/elasticsearch.keystore
348
- subPath: elasticsearch.keystore
349
- {{ end }}
350
- {{- range .Values.secretMounts }}
351
- - name: {{ .name }}
352
- mountPath: {{ .path }}
353
- {{- if .subPath }}
354
- subPath: {{ .subPath }}
355
- {{- end }}
356
- {{- end }}
357
- {{- range $path, $config := .Values.esConfig }}
358
- - name: esconfig
359
- mountPath: /usr/share/elasticsearch/config/{{ $path }}
360
- subPath: {{ $path }}
361
- {{- end -}}
362
- {{- range $path, $config := .Values.esJvmOptions }}
363
- - name: esjvmoptions
364
- mountPath: /usr/share/elasticsearch/config/jvm.options.d/{{ $path }}
365
- subPath: {{ $path }}
366
- {{- end -}}
367
- {{- if .Values.extraVolumeMounts }}
368
- # Currently some extra blocks accept strings
369
- # to continue with backwards compatibility this is being kept
370
- # whilst also allowing for yaml to be specified too.
371
- {{- if eq "string" (printf "%T" .Values.extraVolumeMounts) }}
372
- {{ tpl .Values.extraVolumeMounts . | indent 10 }}
373
- {{- else }}
374
- {{ toYaml .Values.extraVolumeMounts | indent 10 }}
375
- {{- end }}
376
- {{- end }}
377
- {{- if .Values.lifecycle }}
378
- lifecycle:
379
- {{ toYaml .Values.lifecycle | indent 10 }}
380
- {{- end }}
381
- {{- if .Values.extraContainers }}
382
- # Currently some extra blocks accept strings
383
- # to continue with backwards compatibility this is being kept
384
- # whilst also allowing for yaml to be specified too.
385
- {{- if eq "string" (printf "%T" .Values.extraContainers) }}
386
- {{ tpl .Values.extraContainers . | indent 6 }}
387
- {{- else }}
388
- {{ toYaml .Values.extraContainers | indent 6 }}
389
- {{- end }}
390
- {{- end }}