diff --git a/charts/go-monorepo/Chart.yaml b/charts/go-monorepo/Chart.yaml index abddef2..2e86fea 100644 --- a/charts/go-monorepo/Chart.yaml +++ b/charts/go-monorepo/Chart.yaml @@ -1,3 +1,3 @@ apiVersion: v2 name: go-monorepo -version: 0.0.13 \ No newline at end of file +version: 0.0.14 \ No newline at end of file diff --git a/charts/go-monorepo/templates/lib/containers.tpl b/charts/go-monorepo/templates/lib/containers.tpl index 5518fac..f6c93c4 100644 --- a/charts/go-monorepo/templates/lib/containers.tpl +++ b/charts/go-monorepo/templates/lib/containers.tpl @@ -22,4 +22,4 @@ - containerPort: {{ .Values.port }} name: http {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/charts/go-monorepo/templates/lib/initContainers.tpl b/charts/go-monorepo/templates/lib/initContainers.tpl new file mode 100644 index 0000000..658cf61 --- /dev/null +++ b/charts/go-monorepo/templates/lib/initContainers.tpl @@ -0,0 +1,19 @@ +{{ define "common.initContainers" }} +- name: init + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + resources: {{ .Values.resources | toYaml | nindent 4 }} + command: {{ .Values.init.command | toYaml | nindent 4 }} + args: {{ .Values.init.args | toYaml | nindent 4 }} + envFrom: + {{ if .Values.secrets.enabled }} + - secretRef: + name: {{ .Release.Name }}-envs + {{ end }} + {{ if .Values.envs }} + - configMapRef: + name: {{ .Release.Name }}-envs + {{ end }} + {{ if .Values.env }} + env: {{ .Values.env | toYaml | nindent 2 }} + {{ end }} +{{ end }} diff --git a/charts/go-monorepo/templates/lib/pod.tpl b/charts/go-monorepo/templates/lib/pod.tpl index fb4ac1f..b530575 100644 --- a/charts/go-monorepo/templates/lib/pod.tpl +++ b/charts/go-monorepo/templates/lib/pod.tpl @@ -3,4 +3,5 @@ imagePullSecrets: {{ .Values.imagePullSecrets | toYaml | nindent 2 }} {{ end }} containers: {{ include "common.containers" . | nindent 2 }} +initContainers: {{ include "common.initContainers" . | nindent 2 }} {{ end }} \ No newline at end of file diff --git a/charts/go-monorepo/values.yaml b/charts/go-monorepo/values.yaml index a66fac7..457bede 100644 --- a/charts/go-monorepo/values.yaml +++ b/charts/go-monorepo/values.yaml @@ -49,4 +49,13 @@ rabbitmq: # create: true # cluster: # name: - # namespace: \ No newline at end of file + # namespace: + +init: + enabled: false + command: + - river + args: + - migrate-up + - --database-url + - "$DATABASE_URL" \ No newline at end of file