From ba9d67cef32dc3cf2fcf509e54e0a100066a421a Mon Sep 17 00:00:00 2001 From: Tommy Date: Wed, 31 Jan 2024 16:26:08 +0100 Subject: [PATCH] feat(netbox) add support for initcontainers --- charts/netbox/Chart.yaml | 2 +- charts/netbox/templates/db-init.yaml | 20 ++++++++++++++++++++ charts/netbox/values.yaml | 9 +++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 charts/netbox/templates/db-init.yaml diff --git a/charts/netbox/Chart.yaml b/charts/netbox/Chart.yaml index 9077c80..734356d 100644 --- a/charts/netbox/Chart.yaml +++ b/charts/netbox/Chart.yaml @@ -4,7 +4,7 @@ description: | An IP address management (IPAM) and data center infrastructure management (DCIM) tool. appVersion: v3.7.1 type: application -version: 6.0.0 +version: 6.0.1 maintainers: - name: Tommy Skaug email: tommy@skaug.me diff --git a/charts/netbox/templates/db-init.yaml b/charts/netbox/templates/db-init.yaml new file mode 100644 index 0000000..f1cdf26 --- /dev/null +++ b/charts/netbox/templates/db-init.yaml @@ -0,0 +1,20 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "netbox.fullname" . }}-db-init + labels: + {{- include "netbox.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded +spec: + template: + spec: + restartPolicy: Never + containers: + - name: general-db-init + image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}" + envFrom: + - secretRef: + name: {{ .Values.existingSecret }} + backoffLimit: 3 \ No newline at end of file diff --git a/charts/netbox/values.yaml b/charts/netbox/values.yaml index 196cc5f..df59da4 100644 --- a/charts/netbox/values.yaml +++ b/charts/netbox/values.yaml @@ -1,5 +1,14 @@ replicaCount: 1 +initContainers: + dbInit: + image: + repository: ghcr.io/onedr0p/postgres-init + tag: "16" + envFrom: + - secretRef: + name: netbox-secret + image: repository: quay.io/netboxcommunity/netbox tag: v3.7.1