Fixes #125 ### Motivation The default images in the values.yaml are in docker hub. This PR allows us to provide image pull secrets for the containers which will allow us to get around Docker Hub's rate limiting if the nodes are not logged into Docker Hub. ### Modifications Added a new template to generate `imagePullSecrets`, and included them in the deployments and statefulsets. This will only add them if they are specified under `images.imagePullSecrets` ### Verifying this change - [] Make sure that the change passes the CI checks.
99 lines
2.3 KiB
Smarty
99 lines
2.3 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 -}}
|
|
|
|
{{/*
|
|
Expand the namespace of the chart.
|
|
*/}}
|
|
{{- define "pulsar.namespace" -}}
|
|
{{- default .Release.Namespace .Values.namespace -}}
|
|
{{- 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 }}
|
|
|
|
{{/*
|
|
Create ImagePullSecrets
|
|
*/}}
|
|
{{- define "pulsar.imagePullSecrets" -}}
|
|
{{- if .Values.images.imagePullSecrets -}}
|
|
imagePullSecrets:
|
|
{{- range .Values.images.imagePullSecrets }}
|
|
- name: {{ . }}
|
|
{{- end }}
|
|
{{- end -}}
|
|
{{- end }}
|