blob: b77d72328f364a7e3543f7eb5eea77b74a691259 [file] [log] [blame]
{{- if .Values.placementConfig.enabled -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "couchdb.fullname" . }}
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
"helm.sh/hook": post-install
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation
spec:
template:
metadata:
name: "{{ .Release.Name }}"
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
spec:
restartPolicy: OnFailure
containers:
- name: placement-tagging-job
image: {{ .Values.placementConfig.image.repository }}:{{ .Values.placementConfig.image.tag }}
imagePullPolicy: Always
args: ["--placement-manager"]
envFrom:
- secretRef:
name: couchdb-couchdb
- configMapRef:
name: {{ template "couchdb.fullname" . }}
env:
- name: NAMESPACE
value: {{ .Release.Namespace }}
- name: COUCHDB_SVC
value: {{ template "couchdb.svcname" . }}
- name: COUCHDB_PORT
value: {{ .Values.service.externalPort | quote }}
{{- end -}}