mirror of
https://github.com/bitnami/charts.git
synced 2026-02-19 19:47:22 +08:00
55 lines
2.0 KiB
YAML
55 lines
2.0 KiB
YAML
{{- /*
|
|
Copyright VMware, Inc.
|
|
SPDX-License-Identifier: APACHE-2.0
|
|
*/}}
|
|
|
|
{{- if .Values.waitForBackends.enabled }}
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ include "scdf.fullname" . }}-scripts
|
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
namespace: {{ .Release.Namespace }}
|
|
{{- if .Values.commonAnnotations }}
|
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
data:
|
|
{{- $mariadbFullname := include "scdf.mariadb.fullname" . }}
|
|
{{- $rabbitmqFullname := include "scdf.rabbitmq.fullname" . }}
|
|
{{- $kafkaFullname := include "scdf.kafka.fullname" . }}
|
|
{{- $releaseNamespace := .Release.Namespace }}
|
|
wait-for-backends.sh: |-
|
|
#!/bin/bash
|
|
|
|
set -o errexit
|
|
set -o pipefail
|
|
set -o nounset
|
|
|
|
# Auxiliary functions
|
|
k8s_wait_for_statefulset() {
|
|
namespace=${1:?namespace is missing}
|
|
statefulset=${2:?statefulset name is missing}
|
|
local -i return_code=0
|
|
|
|
echo "Waiting for statefulset ${statefulset} to be successfully rolled out..."
|
|
kubectl rollout status --namespace "$namespace" statefulset "$statefulset" >/dev/null 2>&1 || return_code=$?
|
|
echo "Rollout exit code: '${return_code}'"
|
|
return $return_code
|
|
}
|
|
{{- if .Values.mariadb.enabled }}
|
|
k8s_wait_for_statefulset {{ $releaseNamespace }} {{ $mariadbFullname }}
|
|
{{- end }}
|
|
{{- if or .Values.skipper.enabled .Values.server.configuration.streamingEnabled }}
|
|
{{- if .Values.rabbitmq.enabled }}
|
|
k8s_wait_for_statefulset {{ $releaseNamespace }} {{ $rabbitmqFullname }}
|
|
{{- else if .Values.kafka.enabled }}
|
|
{{- if gt (int .Values.kafka.controller.replicaCount) 0 }}
|
|
k8s_wait_for_statefulset {{ $releaseNamespace }} {{ $kafkaFullname }}-controller
|
|
{{- end }}
|
|
{{- if gt (int .Values.kafka.broker.replicaCount) 0 }}
|
|
k8s_wait_for_statefulset {{ $releaseNamespace }} {{ $kafkaFullname }}-broker
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|