From b51e695e99e166639c9f2cea7f921b8d85076d38 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Mon, 30 Aug 2021 12:52:35 +0200 Subject: [PATCH] fix: adjust kubezero argocd flow once more --- charts/kubezero-argocd/values.yaml | 4 ++++ charts/kubezero/Chart.yaml | 2 +- charts/kubezero/bootstrap.sh | 10 +++++++--- charts/kubezero/templates/argocd.yaml | 5 +++++ charts/kubezero/templates/kubezero.yaml | 5 ++--- charts/kubezero/values.yaml | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/charts/kubezero-argocd/values.yaml b/charts/kubezero-argocd/values.yaml index d187f03..23af3b7 100644 --- a/charts/kubezero-argocd/values.yaml +++ b/charts/kubezero-argocd/values.yaml @@ -106,6 +106,10 @@ argo-cd: argocd-applicationset: enabled: false + # Prevent accidental cascading deletes of Applications + args: + policy: create-update + rbac: pspEnabled: false diff --git a/charts/kubezero/Chart.yaml b/charts/kubezero/Chart.yaml index 4efec97..8685e93 100644 --- a/charts/kubezero/Chart.yaml +++ b/charts/kubezero/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero description: KubeZero - Bootstrap and ArgoCD Root App of Apps chart type: application -version: 1.20.8-4 +version: 1.20.8-5 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png keywords: diff --git a/charts/kubezero/bootstrap.sh b/charts/kubezero/bootstrap.sh index 7412fd2..1a4b6a0 100755 --- a/charts/kubezero/bootstrap.sh +++ b/charts/kubezero/bootstrap.sh @@ -194,9 +194,13 @@ function metrics-pre() { ## MAIN ## -# First lets generate kubezero.yaml -# Add all yaml files in $CLUSTER -VALUES="$(find $CLUSTER -maxdepth 1 -name '*.yaml' | sort | tr '\n' ',')" +# First lets generate kubezero.yaml, either plain values.yaml or application.yaml for ArgoCD +if [ -f $CLUSTER/kubezero/application.yaml ]; then + yq r $CLUSTER/kubezero/application.yaml 'spec.source.helm.values' > $TMPDIR/_argovalues.yaml + VALUES=$TMPDIR/_argovalues.yaml +else + VALUES="$(find $CLUSTER -name '*.yaml' | sort | tr '\n' ',')" +fi helm template $(chart_location kubezero) -f ${VALUES%%,} $KUBEZERO_VERSION > $TMPDIR/kubezero.yaml # Resolve all the all enabled artifacts in order of their appearance diff --git a/charts/kubezero/templates/argocd.yaml b/charts/kubezero/templates/argocd.yaml index 5cf2932..ef0e430 100644 --- a/charts/kubezero/templates/argocd.yaml +++ b/charts/kubezero/templates/argocd.yaml @@ -24,6 +24,11 @@ istio: {{- end }} {{- end }} +{{- with index .Values "argocd" "argocd-applicationset" }} +argocd-applicationset: + {{ toYaml . | nindent 2 }} +{{- end }} + {{- end }} {{- define "argocd-argo" }} diff --git a/charts/kubezero/templates/kubezero.yaml b/charts/kubezero/templates/kubezero.yaml index a289275..3ff1027 100644 --- a/charts/kubezero/templates/kubezero.yaml +++ b/charts/kubezero/templates/kubezero.yaml @@ -56,9 +56,8 @@ spec: targetRevision: {{ .Values.kubezero.gitSync.targetRevision }} path: {{ .Values.kubezero.gitSync.path }} - helm: - valueFiles: - - kubezero.yaml + directory: + recurse: true destination: server: https://kubernetes.default.svc diff --git a/charts/kubezero/values.yaml b/charts/kubezero/values.yaml index 8396262..8ccfdfb 100644 --- a/charts/kubezero/values.yaml +++ b/charts/kubezero/values.yaml @@ -62,7 +62,7 @@ logging: enabled: false crds: true namespace: logging - targetRevision: 0.7.8 + targetRevision: 0.7.9 argocd: enabled: false