Add configurable liveness probe for elasticsearch client

Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: I46e1382123ce4497e3f8e414a83fe0861f0cf43b
This commit is contained in:
Ruslan Aliev 2023-04-07 14:46:11 -05:00
parent 35bad7ea02
commit c4a9e8b03d
4 changed files with 15 additions and 8 deletions

View File

@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v7.6.2 appVersion: v7.6.2
description: OpenStack-Helm ElasticSearch description: OpenStack-Helm ElasticSearch
name: elasticsearch name: elasticsearch
version: 0.2.22 version: 0.2.23
home: https://www.elastic.co/ home: https://www.elastic.co/
sources: sources:
- https://github.com/elastic/elasticsearch - https://github.com/elastic/elasticsearch

View File

@ -12,7 +12,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- define "probeTemplate" }} {{- define "readinessProbeTemplate" }}
{{- $probePort := tuple "elasticsearch" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- $probePort := tuple "elasticsearch" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $probeUser := .Values.endpoints.elasticsearch.auth.admin.username }} {{- $probeUser := .Values.endpoints.elasticsearch.auth.admin.username }}
{{- $probePass := .Values.endpoints.elasticsearch.auth.admin.password }} {{- $probePass := .Values.endpoints.elasticsearch.auth.admin.password }}
@ -25,6 +25,11 @@ httpGet:
- name: Authorization - name: Authorization
value: Basic {{ $authHeader }} value: Basic {{ $authHeader }}
{{- end }} {{- end }}
{{- define "livenessProbeTemplate" }}
{{- $probePort := tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
tcpSocket:
port: {{ $probePort }}
{{- end }}
{{- if .Values.manifests.deployment_client }} {{- if .Values.manifests.deployment_client }}
{{- $envAll := . }} {{- $envAll := . }}
@ -143,12 +148,8 @@ spec:
ports: ports:
- name: transport - name: transport
containerPort: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} containerPort: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe: {{ dict "envAll" . "component" "elasticsearch" "container" "elasticsearch-client" "type" "liveness" "probeTemplate" (include "livenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
tcpSocket: {{ dict "envAll" . "component" "elasticsearch" "container" "elasticsearch-client" "type" "readiness" "probeTemplate" (include "readinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
port: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 20
periodSeconds: 10
{{ dict "envAll" . "component" "elasticsearch" "container" "elasticsearch-client" "type" "readiness" "probeTemplate" (include "probeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
env: env:
- name: NAMESPACE - name: NAMESPACE
valueFrom: valueFrom:

View File

@ -297,6 +297,11 @@ pod:
params: params:
initialDelaySeconds: 30 initialDelaySeconds: 30
timeoutSeconds: 30 timeoutSeconds: 30
liveness:
enabled: true
params:
initialDelaySeconds: 30
periodSeconds: 10
mounts: mounts:
elasticsearch: elasticsearch:
elasticsearch: elasticsearch:

View File

@ -32,4 +32,5 @@ elasticsearch:
- 0.2.20 Set default python for helm test - 0.2.20 Set default python for helm test
- 0.2.21 Added OCI registry authentication - 0.2.21 Added OCI registry authentication
- 0.2.22 Update all Ceph images to Focal - 0.2.22 Update all Ceph images to Focal
- 0.2.23 Add configurable liveness probe for elasticsearch client
... ...