From 79fc8d1f380d3033a54cb0ec0275ecac1c1c2538 Mon Sep 17 00:00:00 2001 From: Joe Lee Date: Mon, 8 May 2023 09:55:41 +0800 Subject: [PATCH] add template for application Signed-off-by: Joe Lee --- .../argocd-apps/ci/application-templates.yaml | 38 ++++++++++++++++ charts/argocd-apps/values.yaml | 43 ++++++++++++++++++- 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 charts/argocd-apps/ci/application-templates.yaml diff --git a/charts/argocd-apps/ci/application-templates.yaml b/charts/argocd-apps/ci/application-templates.yaml new file mode 100644 index 00000000..88a99635 --- /dev/null +++ b/charts/argocd-apps/ci/application-templates.yaml @@ -0,0 +1,38 @@ +applicationTemplates: + - apps: + - name: guestbook + project: guestbook-project + template: |- + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: {{ .name }} + # You'll usually want to add your resources to the argocd namespace. + namespace: argocd + # Add this finalizer ONLY if you want these to cascade delete. + finalizers: + - resources-finalizer.argocd.argoproj.io + # Add labels to your application object. + labels: + name: guestbook + spec: + # The project the application belongs to. + project: {{ .project }} + + # Source of the application manifests + source: + repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo. + targetRevision: HEAD # For Helm, this refers to the chart version. + path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git. + + # helm specific config + chart: chart-name # Set this when pulling directly from a Helm repo. DO NOT set for git-hosted Helm charts. + helm: + passCredentials: false # If true then adds --pass-credentials to Helm commands to pass credentials to all domains + # Extra parameters to set (same as setting through values.yaml, but these take precedence) + parameters: + - name: "nginx-ingress.controller.service.annotations.external-dns\\.alpha\\.kubernetes\\.io/hostname" + value: mydomain.example.com + - name: "ingress.annotations.kubernetes\\.io/tls-acme" + value: "true" + forceString: true # ensures that value is treated as a string \ No newline at end of file diff --git a/charts/argocd-apps/values.yaml b/charts/argocd-apps/values.yaml index 72301ace..d4e49cd7 100644 --- a/charts/argocd-apps/values.yaml +++ b/charts/argocd-apps/values.yaml @@ -40,6 +40,46 @@ applications: [] # - name: url # value: https://argoproj.github.io/ +applicationTemplates: + [] + # - apps: + # - name: guestbook + # project: guestbook-project + # template: |- + # apiVersion: argoproj.io/v1alpha1 + # kind: Application + # metadata: + # name: {{ .name }} + # # You'll usually want to add your resources to the argocd namespace. + # namespace: argocd + # # Add this finalizer ONLY if you want these to cascade delete. + # finalizers: + # - resources-finalizer.argocd.argoproj.io + # # Add labels to your application object. + # labels: + # name: guestbook + # spec: + # # The project the application belongs to. + # project: {{ .project }} + + # # Source of the application manifests + # source: + # repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo. + # targetRevision: HEAD # For Helm, this refers to the chart version. + # path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git. + + # # helm specific config + # chart: chart-name # Set this when pulling directly from a Helm repo. DO NOT set for git-hosted Helm charts. + # helm: + # passCredentials: false # If true then adds --pass-credentials to Helm commands to pass credentials to all domains + # # Extra parameters to set (same as setting through values.yaml, but these take precedence) + # parameters: + # - name: "nginx-ingress.controller.service.annotations.external-dns\\.alpha\\.kubernetes\\.io/hostname" + # value: mydomain.example.com + # - name: "ingress.annotations.kubernetes\\.io/tls-acme" + # value: "true" + # forceString: true # ensures that value is treated as a string + # -- Deploy Argo CD Projects within this helm release # @default -- `[]` (See [values.yaml]) ## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/ @@ -202,7 +242,8 @@ itemTemplates: [] # @default -- `[]` (See [values.yaml]) ## This function in tech preview stage, do expect unstability or breaking changes in newer versions. Bump image.tag if necessary. ## Ref: https://github.com/argoproj-labs/argocd-extensions -extensions: [] +extensions: + [] # - name: example # namespace: argocd # additionalLabels: {}