From 55fdda99f3dd43b858d6e81c4e1472dc5cec2510 Mon Sep 17 00:00:00 2001 From: Deniz Erdogan Date: Tue, 30 Jul 2024 12:24:41 +0200 Subject: [PATCH] try app-of-applicationsets --- charts/argocd-apps/env/local/ui.values.yaml | 33 --------- .../argocd-apps/env/production/ui.values.yaml | 36 --------- .../env/staging/ui.values.yaml.gotmpl | 2 - .../templates/env/local/_ui.values.tpl | 14 ---- .../templates/env/production/_ui.values.tpl | 38 ---------- charts/argocd-apps/templates/wbaas-ui.yaml | 74 ++++++++++++------- .../argocd-config/templates/applications.yaml | 19 +++++ .../templates/applicationsets.yaml | 54 -------------- charts/argocd-config/values.yaml | 1 + 9 files changed, 68 insertions(+), 203 deletions(-) delete mode 100644 charts/argocd-apps/env/local/ui.values.yaml delete mode 100644 charts/argocd-apps/env/production/ui.values.yaml delete mode 100644 charts/argocd-apps/env/staging/ui.values.yaml.gotmpl delete mode 100644 charts/argocd-apps/templates/env/local/_ui.values.tpl delete mode 100644 charts/argocd-apps/templates/env/production/_ui.values.tpl create mode 100644 charts/argocd-config/templates/applications.yaml delete mode 100644 charts/argocd-config/templates/applicationsets.yaml diff --git a/charts/argocd-apps/env/local/ui.values.yaml b/charts/argocd-apps/env/local/ui.values.yaml deleted file mode 100644 index 3346b58d7..000000000 --- a/charts/argocd-apps/env/local/ui.values.yaml +++ /dev/null @@ -1,33 +0,0 @@ -image: - tag: sha-52d3977 - -resources: - requests: - cpu: 1m - memory: 6Mi - limits: - cpu: 10m - memory: 20Mi - -ingress: - enabled: true - annotations: - kubernetes.io/ingress.class: nginx - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/from-to-www-redirect: "true" - hosts: - - host: www.wbaas.localhost - paths: - - /* - tls: null - -ui: - apiUrl: api.wbaas.localhost - subdomainSuffix: ".wbaas.localhost" - cnameConfigMapKey: cname_record - configMapName: wbaas-ui-config - recaptchaSitekeySecretName: recaptcha-v3-secrets - recaptchaSitekeySecretKey: site_key - -podLabels: - sidecar.istio.io/inject: "true" diff --git a/charts/argocd-apps/env/production/ui.values.yaml b/charts/argocd-apps/env/production/ui.values.yaml deleted file mode 100644 index bc153d753..000000000 --- a/charts/argocd-apps/env/production/ui.values.yaml +++ /dev/null @@ -1,36 +0,0 @@ -image: - tag: sha-52d3977 - -resources: - requests: - cpu: 1m - memory: 6Mi - limits: - cpu: 10m - memory: 20Mi - -ingress: - enabled: true - annotations: - kubernetes.io/ingress.class: nginx - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/from-to-www-redirect: "true" - hosts: - - host: www.wikibase.cloud - paths: - - /* - tls: - - hosts: - - www.wikibase.cloud - secretName: wikibase-production-tls - -ui: - apiUrl: https://api.wikibase.cloud - subdomainSuffix: '.wikibase.cloud' - cnameConfigMapKey: cname_record - configMapName: wbaas-ui-config - recaptchaSitekeySecretName: recaptcha-v3-secrets - recaptchaSitekeySecretKey: site_key - -podLabels: - sidecar.istio.io/inject: "true" diff --git a/charts/argocd-apps/env/staging/ui.values.yaml.gotmpl b/charts/argocd-apps/env/staging/ui.values.yaml.gotmpl deleted file mode 100644 index 7590e881e..000000000 --- a/charts/argocd-apps/env/staging/ui.values.yaml.gotmpl +++ /dev/null @@ -1,2 +0,0 @@ -image: - tag: sha-52d3977 diff --git a/charts/argocd-apps/templates/env/local/_ui.values.tpl b/charts/argocd-apps/templates/env/local/_ui.values.tpl deleted file mode 100644 index 527ac3eeb..000000000 --- a/charts/argocd-apps/templates/env/local/_ui.values.tpl +++ /dev/null @@ -1,14 +0,0 @@ -{{- define "wbaas.values.local.ui" -}} -image: - tag: sha-52d3977 - -ui: - recaptchaSitekeySecretName: {{ .Values.external.recaptcha3.secretName }} - recaptchaSitekeySecretKey: site_key - -foo: bar - -ingress: - tls: - foo: bar -{{- end -}} \ No newline at end of file diff --git a/charts/argocd-apps/templates/env/production/_ui.values.tpl b/charts/argocd-apps/templates/env/production/_ui.values.tpl deleted file mode 100644 index 3676ff44b..000000000 --- a/charts/argocd-apps/templates/env/production/_ui.values.tpl +++ /dev/null @@ -1,38 +0,0 @@ -{{- define "wbaas.values.production.ui" -}} -image: - tag: sha-52d3977 - -resources: - requests: - cpu: 1m - memory: 6Mi - limits: - cpu: 10m - memory: 20Mi - -ingress: - enabled: true - annotations: - kubernetes.io/ingress.class: nginx - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/from-to-www-redirect: "true" - hosts: - - host: {{ .Values.uiHostName }} - paths: - - /* - tls: - - hosts: - - {{ .Values.uiHostName }} - secretName: {{ .Values.tlsSecret }} - -ui: - apiUrl: {{ .Values.services.app.apiUrl }} - subdomainSuffix: {{ .Values.wbstack.subdomainSuffix }} - cnameConfigMapKey: cname_record - configMapName: wbaas-ui-config - recaptchaSitekeySecretName: {{ .Values.external.recaptcha3.secretName }} - recaptchaSitekeySecretKey: site_key - -podLabels: - sidecar.istio.io/inject: "true" -{{- end -}} \ No newline at end of file diff --git a/charts/argocd-apps/templates/wbaas-ui.yaml b/charts/argocd-apps/templates/wbaas-ui.yaml index 89a640cfb..39cb3935e 100644 --- a/charts/argocd-apps/templates/wbaas-ui.yaml +++ b/charts/argocd-apps/templates/wbaas-ui.yaml @@ -1,32 +1,54 @@ apiVersion: argoproj.io/v1alpha1 -kind: Application +kind: ApplicationSet metadata: name: ui namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io spec: - destination: - namespace: default - server: {{ .Values.spec.destination.server }} - project: default - source: - path: charts/ui - repoURL: https://github.com/wbstack/charts - targetRevision: test/value-files - helm: - parameters: - - name: helm.debug - value: "true" - valueFiles: - - "values.production.yaml" - {{- if eq .Values.environment "staging" }} - - "values.staging.yaml" - {{ else if eq .Values.environment "local" }} - - "values.local.yaml" - {{- end }} + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + # merge 'parent' generator + - merge: + mergeKeys: + - server + generators: + - git: + repoURL: {{ .Values.repoUrls.main }} + revision: 'de/argo-apps-ui' + # revision: HEAD + files: + # - path: 'charts/argocd-apps/env/production/ui.values.yaml' + - path: 'k8s/argocd/production/ui.values.yaml' + # values: + # server: foo + - git: + repoURL: {{ .Values.repoUrls.main }} + revision: 'de/argo-apps-ui' + # revision: HEAD + files: + - path: 'k8s/argocd/local/ui.values.yaml' + template: + metadata: + name: 'ui' + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io - syncPolicy: - automated: - selfHeal: false - prune: true \ No newline at end of file + spec: + project: default + destination: + server: {{ .Values.spec.destination.server }} + namespace: default + source: + repoURL: {{ .Values.repoUrls.charts }} + targetRevision: HEAD + path: charts/ui + helm: + parameters: + - name: helm.debug + value: "true" + values: '{{ toYaml .Values }}' + syncPolicy: + automated: + prune: false + selfHeal: false \ No newline at end of file diff --git a/charts/argocd-config/templates/applications.yaml b/charts/argocd-config/templates/applications.yaml new file mode 100644 index 000000000..488724a24 --- /dev/null +++ b/charts/argocd-config/templates/applications.yaml @@ -0,0 +1,19 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: app-of-apps +spec: + destination: + server: https://kubernetes.default.svc + project: default + source: + path: charts/argocd-apps + repoURL: {{ .Values.repoUrls.main }} + targetRevision: de/argo-apps-ui # debug! needs to be set to HEAD + helm: + values: | +{{ toYaml .Values | indent 8 }} + syncPolicy: + automated: + prune: true + selfHeal: false \ No newline at end of file diff --git a/charts/argocd-config/templates/applicationsets.yaml b/charts/argocd-config/templates/applicationsets.yaml deleted file mode 100644 index 43539ca66..000000000 --- a/charts/argocd-config/templates/applicationsets.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: ApplicationSet -metadata: - name: ui - namespace: argocd -spec: - goTemplate: true - goTemplateOptions: ["missingkey=error"] - generators: - # merge 'parent' generator - - merge: - mergeKeys: - - server - generators: - - git: - repoURL: https://github.com/wmde/wbaas-deploy.git - # revision: 'de/argo-apps-ui' - revision: HEAD - files: - # - path: 'charts/argocd-apps/env/production/ui.values.yaml' - - path: 'k8s/helmfile/env/production/ui.values.yaml' - # values: - # server: foo - - git: - repoURL: https://github.com/wmde/wbaas-deploy.git - # revision: 'de/argo-apps-ui' - revision: HEAD - files: - # - path: 'charts/argocd-apps/env/local/ui.values.yaml' - - path: 'k8s/helmfile/env/local/ui.values.yaml' - # values: - # server: foo - - template: - metadata: - name: 'ui' - spec: - project: default - source: - repoURL: https://github.com/wbstack/charts.git - targetRevision: HEAD - path: charts/ui - helm: - parameters: - - name: helm.debug - value: "true" - values: '{{ toYaml .Values }}' - destination: - server: https://kubernetes.default.svc - namespace: default - syncPolicy: - automated: - prune: false - selfHeal: false \ No newline at end of file diff --git a/charts/argocd-config/values.yaml b/charts/argocd-config/values.yaml index c5799f0f3..80d12ba1f 100644 --- a/charts/argocd-config/values.yaml +++ b/charts/argocd-config/values.yaml @@ -1,2 +1,3 @@ repoUrls: main: https://github.com/wmde/wbaas-deploy + charts: https://github.com/wbstack/charts.git