From 2ce6b987af2eb3ec09e1aa43e020837f504f67b4 Mon Sep 17 00:00:00 2001 From: Alex Lee <8878798+alee-x@users.noreply.github.com> Date: Fri, 13 Oct 2023 09:51:52 +0100 Subject: [PATCH] feat(chart): add reloader for auto-reload trino pods on cm change (#115) --- .../templates/application/app-reloader.yaml | 32 +++++++++++++++++++ charts/teleport/values.yaml | 10 ++++++ 2 files changed, 42 insertions(+) create mode 100644 charts/teleport/templates/application/app-reloader.yaml diff --git a/charts/teleport/templates/application/app-reloader.yaml b/charts/teleport/templates/application/app-reloader.yaml new file mode 100644 index 00000000..961368f2 --- /dev/null +++ b/charts/teleport/templates/application/app-reloader.yaml @@ -0,0 +1,32 @@ +{{- if .Values.appReloader.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: reloader + namespace: {{ .Values.global.application.argocd.namespace }} + finalizers: + - resources-finalizer.argocd.argoproj.io + annotations: + argocd.argoproj.io/sync-wave: "2" +spec: + destination: + namespace: "{{ .Values.global.namespacePrefix }}-{{ .Values.appReloader.namespace }}" + # this has to be installed alongside Trino, so we use the Trino cluster values + server: {{ eq .Values.appTrino.cluster "" | ternary .Values.global.application.address .Values.appTrino.cluster }} + project: {{ .Values.global.application.argocd.project }} + syncPolicy: + automated: + selfHeal: true + prune: true + syncOptions: + - CreateNamespace=true + source: + {{- .Values.appReloader.source | toYaml | nindent 4 }} + helm: + valueFiles: + - values.yaml + {{- if .Values.appReloader.values }} + values: | + {{- .Values.appReloader.values | toYaml | nindent 8 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/teleport/values.yaml b/charts/teleport/values.yaml index 923fba04..8f63ca86 100644 --- a/charts/teleport/values.yaml +++ b/charts/teleport/values.yaml @@ -76,6 +76,16 @@ appHive: # renovate: datasource=helm depName=hive registryUrl=https://harbor.ukserp.ac.uk/dare/chart targetRevision: 1.2.0 +appReloader: + enabled: true + # this needs to be installed alongside Trino, so it uses the Trino cluster value + namespace: reloader + source: + repoURL: https://stakater.github.io/stakater-charts + chart: reloader + # renovate: datasource=helm depName=reloader registryUrl=https://stakater.github.io/stakater-charts + targetRevision: 1.0.43 + appMinioTenant: enabled: true cluster: ""