From 3ca836304023c99240a85b753d5cbcdec126b29d Mon Sep 17 00:00:00 2001 From: Jonas Juselius Date: Fri, 20 Jun 2025 19:57:38 +0200 Subject: [PATCH] feat: add dapr helmfile et al. --- helmfile.d/dapr.yaml.gotmpl | 40 +++++++++++++++++++++++++++++ justfile | 2 +- values/dapr/env.yaml.gotmpl | 3 ++- values/dapr/manifests/dapr.yaml | 16 +++++++----- values/dapr/values/dapr.yaml.gotmpl | 3 ++- 5 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 helmfile.d/dapr.yaml.gotmpl diff --git a/helmfile.d/dapr.yaml.gotmpl b/helmfile.d/dapr.yaml.gotmpl new file mode 100644 index 00000000..78abd205 --- /dev/null +++ b/helmfile.d/dapr.yaml.gotmpl @@ -0,0 +1,40 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: +- name: dapr + url: https://dapr.github.io/helm-charts + +commonLabels: + tier: system + +releases: +- name: dapr + namespace: dapr-system + chart: dapr/dapr + version: 1.14.4 + condition: dapr.enabled + values: + - ../values/dapr/values/dapr.yaml.gotmpl + - ../values/dapr/values/dapr-{{ .Environment.Name }}.yaml.gotmpl + missingFileHandler: Info +- name: dapr-manifests + namespace: dapr-system + chart: _dapr-manifests + condition: nginx.enabled + missingFileHandler: Info + values: + - ../values/env.yaml + - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml + - ../values/dapr/env.yaml.gotmpl + - ../values/dapr/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/dapr/manifests + - _dapr-manifests diff --git a/justfile b/justfile index 49dfb4d2..be57382b 100644 --- a/justfile +++ b/justfile @@ -4,5 +4,5 @@ default: # Render a specifc helm chart r HELMFILE ENV="default": - helmfile --environment={{ENV}} lint --args --quiet -f helmfile.d/{{HELMFILE}}.yaml.gotmpl + #helmfile --environment={{ENV}} lint --args --quiet -f helmfile.d/{{HELMFILE}}.yaml.gotmpl helmfile --environment={{ENV}} template -q -f helmfile.d/{{HELMFILE}}.yaml.gotmpl --output-dir-template="../_manifests/{{HELMFILE}}/{{ENV}}" diff --git a/values/dapr/env.yaml.gotmpl b/values/dapr/env.yaml.gotmpl index 4b53795e..7110b04f 100644 --- a/values/dapr/env.yaml.gotmpl +++ b/values/dapr/env.yaml.gotmpl @@ -1,2 +1,3 @@ dapr: - enabled: true \ No newline at end of file + enabled: true + autsync: false diff --git a/values/dapr/manifests/dapr.yaml b/values/dapr/manifests/dapr.yaml index 1099eb39..62248775 100644 --- a/values/dapr/manifests/dapr.yaml +++ b/values/dapr/manifests/dapr.yaml @@ -15,17 +15,21 @@ spec: sources: - repoURL: {{ .Values.clusterConfig.manifests }} targetRevision: HEAD - path: helmfiles/dapr + path: helmfile.d plugin: - name: helmfile + name: helmfile-cmp env: - - name: CLUSTER_NAME - value: {{ .Values.clusterConfig.cluster }} - project: default + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: dapr.yaml.gotmpl + project: sys syncPolicy: managedNamespaceMetadata: labels: - component: aux + component: sys syncOptions: - CreateNamespace=true - ApplyOutOfSyncOnly=true diff --git a/values/dapr/values/dapr.yaml.gotmpl b/values/dapr/values/dapr.yaml.gotmpl index f735c996..8d013bc7 100644 --- a/values/dapr/values/dapr.yaml.gotmpl +++ b/values/dapr/values/dapr.yaml.gotmpl @@ -1,3 +1,4 @@ global: ha: - enabled: true + enabled: true + replicaCount: 3