Co-authored-by: Elad Dolev <elad@firebolt.io> ### Motivation Give the ability to deploy multi-cluster instance on K8s clusters with non-default `clusterDomain`, and connect to external configuration-store ### Modifications - give the ability to change cluster's name - give the ability to change `clusterDomain` - fix external configuration store functionality - use broker ports variables - use label templates, and add `component` label in several places ### Verifying this change - [x] Make sure that the change passes the CI checks.
80 lines
1.9 KiB
Smarty
80 lines
1.9 KiB
Smarty
{{/* vim: set filetype=mustache: */}}
|
|
|
|
{{/*
|
|
pulsar home
|
|
*/}}
|
|
{{- define "pulsar.home" -}}
|
|
{{- print "/pulsar" -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Expand the name of the chart.
|
|
*/}}
|
|
{{- define "pulsar.name" -}}
|
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Create a default fully qualified app name.
|
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
If release name contains chart name it will be used as a full name.
|
|
*/}}
|
|
{{- define "pulsar.fullname" -}}
|
|
{{- if .Values.fullnameOverride -}}
|
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
|
{{- else -}}
|
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
|
{{- if contains $name .Release.Name -}}
|
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
|
{{- else -}}
|
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Define cluster's name
|
|
*/}}
|
|
{{- define "pulsar.cluster.name" -}}
|
|
{{- if .Values.clusterName }}
|
|
{{- .Values.clusterName }}
|
|
{{- else -}}
|
|
{{- template "pulsar.fullname" .}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Create chart name and version as used by the chart label.
|
|
*/}}
|
|
{{- define "pulsar.chart" -}}
|
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Create the common labels.
|
|
*/}}
|
|
{{- define "pulsar.standardLabels" -}}
|
|
app: {{ template "pulsar.name" . }}
|
|
chart: {{ template "pulsar.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
cluster: {{ template "pulsar.cluster.name" . }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Create the template labels.
|
|
*/}}
|
|
{{- define "pulsar.template.labels" -}}
|
|
app: {{ template "pulsar.name" . }}
|
|
release: {{ .Release.Name }}
|
|
cluster: {{ template "pulsar.cluster.name" . }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Create the match labels.
|
|
*/}}
|
|
{{- define "pulsar.matchLabels" -}}
|
|
app: {{ template "pulsar.name" . }}
|
|
release: {{ .Release.Name }}
|
|
{{- end }}
|