From d2e7ae41c171b6f3a6aea9d6f0d178e7bafa39fd Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Tue, 19 May 2020 12:07:58 +0100 Subject: [PATCH] Switch root app to use common labels --- charts/kubezero-app/Chart.yaml | 6 +++++- .../templates/{_apps_common.yaml => _app.yaml} | 7 ++----- charts/kubezero-app/templates/calico.yaml | 2 +- charts/kubezero-app/templates/cert-manager.yaml | 4 +++- charts/kubezero-app/templates/kiam.yaml | 2 +- .../kubezero-app/templates/local-volume-provisioner.yaml | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) rename charts/kubezero-app/templates/{_apps_common.yaml => _app.yaml} (79%) diff --git a/charts/kubezero-app/Chart.yaml b/charts/kubezero-app/Chart.yaml index 3110b309..f14be381 100644 --- a/charts/kubezero-app/Chart.yaml +++ b/charts/kubezero-app/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero-app description: KubeZero ArgoCD Application - Root chart of the KubeZero type: application -version: 0.2.0 +version: 0.2.1 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/logo_small.png keywords: @@ -11,4 +11,8 @@ keywords: - gitops maintainers: - name: Quarky9 +dependencies: + - name: kubezero-lib + version: ">= 0.1.1" + repository: https://zero-down-time.github.io/kubezero/ kubeVersion: ">= 1.16.0" diff --git a/charts/kubezero-app/templates/_apps_common.yaml b/charts/kubezero-app/templates/_app.yaml similarity index 79% rename from charts/kubezero-app/templates/_apps_common.yaml rename to charts/kubezero-app/templates/_app.yaml index 2b44ab7e..17346942 100644 --- a/charts/kubezero-app/templates/_apps_common.yaml +++ b/charts/kubezero-app/templates/_app.yaml @@ -1,14 +1,11 @@ -{{- define "kubezero.app" }} +{{- define "kubezero-app.app" }} apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: {{ .name | lower }} namespace: argocd labels: - app.kubernetes.io/name: {{ .name }} - helm.sh/chart: {{ .root.Chart.Name }}-{{ .root.Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: {{ .root.Release.Service }} - app.kubernetes.io/part-of: kubezero +{{ include "kubezero-lib.labels" .root | indent 4 }} {{- if not .retain }} finalizers: - resources-finalizer.argocd.argoproj.io diff --git a/charts/kubezero-app/templates/calico.yaml b/charts/kubezero-app/templates/calico.yaml index 8b0ee582..33aa8442 100644 --- a/charts/kubezero-app/templates/calico.yaml +++ b/charts/kubezero-app/templates/calico.yaml @@ -1,3 +1,3 @@ {{- if .Values.calico.enabled }} -{{ template "kubezero.app" dict "root" . "name" "calico" "type" "kustomize" "retain" true }} +{{ template "kubezero-app.app" dict "root" . "name" "calico" "type" "kustomize" "retain" true }} {{- end }} diff --git a/charts/kubezero-app/templates/cert-manager.yaml b/charts/kubezero-app/templates/cert-manager.yaml index 5774f5bb..b744db82 100644 --- a/charts/kubezero-app/templates/cert-manager.yaml +++ b/charts/kubezero-app/templates/cert-manager.yaml @@ -1,10 +1,12 @@ {{- if index .Values "cert-manager" "enabled" }} -{{ template "kubezero.app" dict "root" . "name" "cert-manager" "type" "helm" "namespace" "cert-manager" }} +{{ template "kubezero-app.app" dict "root" . "name" "cert-manager" "type" "helm" "namespace" "cert-manager" }} --- apiVersion: v1 kind: Namespace metadata: name: cert-manager +{{- if index .Values "kiam" "enabled" }} annotations: iam.amazonaws.com/permitted: ".*CertManagerRole.*" {{- end }} +{{- end }} diff --git a/charts/kubezero-app/templates/kiam.yaml b/charts/kubezero-app/templates/kiam.yaml index 298f6fbc..78c34af3 100644 --- a/charts/kubezero-app/templates/kiam.yaml +++ b/charts/kubezero-app/templates/kiam.yaml @@ -1,3 +1,3 @@ {{- if index .Values "kiam" "enabled" }} -{{ template "kubezero.app" dict "root" . "name" "kiam" "type" "helm" }} +{{ template "kubezero-app.app" dict "root" . "name" "kiam" "type" "helm" }} {{- end }} diff --git a/charts/kubezero-app/templates/local-volume-provisioner.yaml b/charts/kubezero-app/templates/local-volume-provisioner.yaml index 490efbbd..e52c9208 100644 --- a/charts/kubezero-app/templates/local-volume-provisioner.yaml +++ b/charts/kubezero-app/templates/local-volume-provisioner.yaml @@ -1,3 +1,3 @@ {{- if index .Values "local-volume-provisioner" "enabled" }} -{{ template "kubezero.app" dict "root" . "name" "local-volume-provisioner" "type" "kustomize" }} +{{ template "kubezero-app.app" dict "root" . "name" "local-volume-provisioner" "type" "kustomize" }} {{- end }}