fix issue
Signed-off-by: Joe Lee <lj_2005@163.com>
This commit is contained in:
parent
4c319c7730
commit
ca437f12ad
12 changed files with 263 additions and 82 deletions
|
@ -29,7 +29,6 @@ $ helm install my-release argo/argocd-apps
|
||||||
| Key | Type | Default | Description |
|
| Key | Type | Default | Description |
|
||||||
|-----|------|---------|-------------|
|
|-----|------|---------|-------------|
|
||||||
| applications | list | `[]` (See [values.yaml]) | Deploy Argo CD Applications within this helm release |
|
| applications | list | `[]` (See [values.yaml]) | Deploy Argo CD Applications within this helm release |
|
||||||
| applicationTemplates | list | `[]` (See [values.yaml]) | Deploy Argo CD Applications within this helm release base on template |
|
|
||||||
| applicationsets | list | `[]` (See [values.yaml]) | Deploy Argo CD ApplicationSets within this helm release |
|
| applicationsets | list | `[]` (See [values.yaml]) | Deploy Argo CD ApplicationSets within this helm release |
|
||||||
| extensions | list | `[]` (See [values.yaml]) | Deploy Argo UI Extensions within this helm release |
|
| extensions | list | `[]` (See [values.yaml]) | Deploy Argo UI Extensions within this helm release |
|
||||||
| itemTemplates | list | `[]` (See [values.yaml]) | Deploy Argo CD Applications/ApplicationSets/Projects within this helm release |
|
| itemTemplates | list | `[]` (See [values.yaml]) | Deploy Argo CD Applications/ApplicationSets/Projects within this helm release |
|
||||||
|
|
28
charts/argocd-apps/ci/application-templates-string.yaml
Normal file
28
charts/argocd-apps/ci/application-templates-string.yaml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
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
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: guestbook
|
||||||
|
directory:
|
||||||
|
recurse: true
|
28
charts/argocd-apps/ci/application-templates-yaml.yaml
Normal file
28
charts/argocd-apps/ci/application-templates-yaml.yaml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
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
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: guestbook
|
||||||
|
directory:
|
||||||
|
recurse: true
|
|
@ -1,38 +0,0 @@
|
||||||
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
|
|
31
charts/argocd-apps/ci/applicationset-templates-string.yaml
Normal file
31
charts/argocd-apps/ci/applicationset-templates-string.yaml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
applicationsetTemplates:
|
||||||
|
- appSets:
|
||||||
|
- name: my-appset
|
||||||
|
generators:
|
||||||
|
- list:
|
||||||
|
elements:
|
||||||
|
- cluster: engineering-dev
|
||||||
|
url: https://1.2.3.4
|
||||||
|
- cluster: engineering-prod
|
||||||
|
url: https://2.4.6.8
|
||||||
|
- cluster: finance-preprod
|
||||||
|
url: https://9.8.7.6
|
||||||
|
template: |-
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: ApplicationSet
|
||||||
|
metadata:
|
||||||
|
name: {{ .name }}
|
||||||
|
spec:
|
||||||
|
generators: {{ toYaml .generators | nindent 4 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: '{{`{{cluster}}`}}-guestbook'
|
||||||
|
spec:
|
||||||
|
project: my-project
|
||||||
|
source:
|
||||||
|
repoURL: https://github.com/infra-team/cluster-deployments.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: guestbook/{{`{{cluster}}`}}
|
||||||
|
destination:
|
||||||
|
server: '{{`{{cluster}}`}}'
|
||||||
|
namespace: guestbook
|
31
charts/argocd-apps/ci/applicationset-templates-yaml.yaml
Normal file
31
charts/argocd-apps/ci/applicationset-templates-yaml.yaml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
applicationsetTemplates:
|
||||||
|
- appSets:
|
||||||
|
- name: my-appset
|
||||||
|
generators:
|
||||||
|
- list:
|
||||||
|
elements:
|
||||||
|
- cluster: engineering-dev
|
||||||
|
url: https://1.2.3.4
|
||||||
|
- cluster: engineering-prod
|
||||||
|
url: https://2.4.6.8
|
||||||
|
- cluster: finance-preprod
|
||||||
|
url: https://9.8.7.6
|
||||||
|
template:
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: ApplicationSet
|
||||||
|
metadata:
|
||||||
|
name: "{{ .name }}"
|
||||||
|
spec:
|
||||||
|
generators: "{{ toYaml .generators | nindent 4 }}"
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: '{{`{{cluster}}`}}-guestbook'
|
||||||
|
spec:
|
||||||
|
project: my-project
|
||||||
|
source:
|
||||||
|
repoURL: https://github.com/infra-team/cluster-deployments.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: guestbook/{{`{{cluster}}`}}
|
||||||
|
destination:
|
||||||
|
server: '{{`{{cluster}}`}}'
|
||||||
|
namespace: guestbook
|
27
charts/argocd-apps/ci/project-template-string.yaml
Normal file
27
charts/argocd-apps/ci/project-template-string.yaml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
projectTemplates:
|
||||||
|
- projects:
|
||||||
|
- name: my-project
|
||||||
|
namespace: my-namespace
|
||||||
|
template: |-
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: AppProject
|
||||||
|
metadata:
|
||||||
|
name: {{ .name }}
|
||||||
|
namespace: argocd
|
||||||
|
# Finalizer that ensures that project is not deleted until it is not referenced by any application
|
||||||
|
finalizers:
|
||||||
|
- resources-finalizer.argocd.argoproj.io
|
||||||
|
spec:
|
||||||
|
# Project description
|
||||||
|
description: Example Project
|
||||||
|
|
||||||
|
# Allow manifests to deploy from any Git repos
|
||||||
|
sourceRepos:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
# Only permit applications to deploy to the guestbook namespace in the same cluster
|
||||||
|
# Destination clusters can be identified by 'server', 'name', or both.
|
||||||
|
destinations:
|
||||||
|
- namespace: {{ .namespace }}
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
name: in-cluster
|
27
charts/argocd-apps/ci/project-template-yaml.yaml
Normal file
27
charts/argocd-apps/ci/project-template-yaml.yaml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
projectTemplates:
|
||||||
|
- projects:
|
||||||
|
- name: my-project
|
||||||
|
namespace: my-namespace
|
||||||
|
template:
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: AppProject
|
||||||
|
metadata:
|
||||||
|
name: "{{ .name }}"
|
||||||
|
namespace: argocd
|
||||||
|
# Finalizer that ensures that project is not deleted until it is not referenced by any application
|
||||||
|
finalizers:
|
||||||
|
- resources-finalizer.argocd.argoproj.io
|
||||||
|
spec:
|
||||||
|
# Project description
|
||||||
|
description: Example Project
|
||||||
|
|
||||||
|
# Allow manifests to deploy from any Git repos
|
||||||
|
sourceRepos:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
# Only permit applications to deploy to the guestbook namespace in the same cluster
|
||||||
|
# Destination clusters can be identified by 'server', 'name', or both.
|
||||||
|
destinations:
|
||||||
|
- namespace: "{{ .namespace }}"
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
name: in-cluster
|
|
@ -59,8 +59,7 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- $template := .template | toYaml -}}
|
{{- $template := .template | toYaml -}}
|
||||||
{{- range .items }}
|
{{- range .apps }}
|
||||||
---
|
|
||||||
{{ tpl $template (set . "Template" $.Template) }}
|
{{ tpl $template (set . "Template" $.Template) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -77,3 +77,17 @@ spec:
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
---
|
||||||
|
{{- range .Values.applicationsetTemplates }}
|
||||||
|
{{- if kindIs "string" .template }}
|
||||||
|
{{- $template := .template -}}
|
||||||
|
{{- range .appSets }}
|
||||||
|
{{ tpl $template (set . "Template" $.Template) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $template := .template | toYaml -}}
|
||||||
|
{{- range .appSets }}
|
||||||
|
{{ tpl $template (set . "Template" $.Template) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
|
@ -68,3 +68,17 @@ spec:
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
---
|
||||||
|
{{- range .Values.projectTemplates }}
|
||||||
|
{{- if kindIs "string" .template }}
|
||||||
|
{{- $template := .template -}}
|
||||||
|
{{- range .projects }}
|
||||||
|
{{ tpl $template (set . "Template" $.Template) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $template := .template | toYaml -}}
|
||||||
|
{{- range .projects }}
|
||||||
|
{{ tpl $template (set . "Template" $.Template) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
|
@ -40,45 +40,42 @@ applications: []
|
||||||
# - name: url
|
# - name: url
|
||||||
# value: https://argoproj.github.io/
|
# value: https://argoproj.github.io/
|
||||||
|
|
||||||
applicationTemplates:
|
applicationTemplates: []
|
||||||
[]
|
# - apps:
|
||||||
# - apps:
|
# - name: guestbook
|
||||||
# - name: guestbook
|
# project: guestbook-project
|
||||||
# project: guestbook-project
|
# template: |-
|
||||||
# template: |-
|
# apiVersion: argoproj.io/v1alpha1
|
||||||
# apiVersion: argoproj.io/v1alpha1
|
# kind: Application
|
||||||
# kind: Application
|
# metadata:
|
||||||
# metadata:
|
# name: {{ .name }}
|
||||||
# name: {{ .name }}
|
# # You'll usually want to add your resources to the argocd namespace.
|
||||||
# # You'll usually want to add your resources to the argocd namespace.
|
# namespace: argocd
|
||||||
# namespace: argocd
|
# # Add this finalizer ONLY if you want these to cascade delete.
|
||||||
# # Add this finalizer ONLY if you want these to cascade delete.
|
# finalizers:
|
||||||
# finalizers:
|
# - resources-finalizer.argocd.argoproj.io
|
||||||
# - resources-finalizer.argocd.argoproj.io
|
# # Add labels to your application object.
|
||||||
# # Add labels to your application object.
|
# labels:
|
||||||
# labels:
|
# name: guestbook
|
||||||
# name: guestbook
|
# spec:
|
||||||
# spec:
|
# # The project the application belongs to.
|
||||||
# # The project the application belongs to.
|
# project: {{ .project }}
|
||||||
# project: {{ .project }}
|
# # Source of the application manifests
|
||||||
|
# source:
|
||||||
# # Source of the application manifests
|
# repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo.
|
||||||
# source:
|
# targetRevision: HEAD # For Helm, this refers to the chart version.
|
||||||
# repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo.
|
# path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
|
||||||
# targetRevision: HEAD # For Helm, this refers to the chart version.
|
# # helm specific config
|
||||||
# path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
|
# chart: chart-name # Set this when pulling directly from a Helm repo. DO NOT set for git-hosted Helm charts.
|
||||||
|
# helm:
|
||||||
# # helm specific config
|
# passCredentials: false # If true then adds --pass-credentials to Helm commands to pass credentials to all domains
|
||||||
# chart: chart-name # Set this when pulling directly from a Helm repo. DO NOT set for git-hosted Helm charts.
|
# # Extra parameters to set (same as setting through values.yaml, but these take precedence)
|
||||||
# helm:
|
# parameters:
|
||||||
# passCredentials: false # If true then adds --pass-credentials to Helm commands to pass credentials to all domains
|
# - name: "nginx-ingress.controller.service.annotations.external-dns\\.alpha\\.kubernetes\\.io/hostname"
|
||||||
# # Extra parameters to set (same as setting through values.yaml, but these take precedence)
|
# value: mydomain.example.com
|
||||||
# parameters:
|
# - name: "ingress.annotations.kubernetes\\.io/tls-acme"
|
||||||
# - name: "nginx-ingress.controller.service.annotations.external-dns\\.alpha\\.kubernetes\\.io/hostname"
|
# value: "true"
|
||||||
# value: mydomain.example.com
|
# forceString: true # ensures that value is treated as a string
|
||||||
# - 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
|
# -- Deploy Argo CD Projects within this helm release
|
||||||
# @default -- `[]` (See [values.yaml])
|
# @default -- `[]` (See [values.yaml])
|
||||||
|
@ -126,6 +123,31 @@ projects: []
|
||||||
# sourceNamespaces:
|
# sourceNamespaces:
|
||||||
# - argocd
|
# - argocd
|
||||||
|
|
||||||
|
projectTemplates: []
|
||||||
|
# - projects:
|
||||||
|
# - name: my-project
|
||||||
|
# namespace: my-namespace
|
||||||
|
# template: |-
|
||||||
|
# apiVersion: argoproj.io/v1alpha1
|
||||||
|
# kind: AppProject
|
||||||
|
# metadata:
|
||||||
|
# name: {{ .name }}
|
||||||
|
# namespace: argocd
|
||||||
|
# # Finalizer that ensures that project is not deleted until it is not referenced by any application
|
||||||
|
# finalizers:
|
||||||
|
# - resources-finalizer.argocd.argoproj.io
|
||||||
|
# spec:
|
||||||
|
# # Project description
|
||||||
|
# description: Example Project
|
||||||
|
# # Allow manifests to deploy from any Git repos
|
||||||
|
# sourceRepos:
|
||||||
|
# - '*'
|
||||||
|
# # Only permit applications to deploy to the guestbook namespace in the same cluster
|
||||||
|
# # Destination clusters can be identified by 'server', 'name', or both.
|
||||||
|
# destinations:
|
||||||
|
# - namespace: {{ .namespace }}
|
||||||
|
# server: https://kubernetes.default.svc
|
||||||
|
# name: in-cluster
|
||||||
# -- Deploy Argo CD ApplicationSets within this helm release
|
# -- Deploy Argo CD ApplicationSets within this helm release
|
||||||
# @default -- `[]` (See [values.yaml])
|
# @default -- `[]` (See [values.yaml])
|
||||||
## Ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/
|
## Ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/
|
||||||
|
@ -242,8 +264,7 @@ itemTemplates: []
|
||||||
# @default -- `[]` (See [values.yaml])
|
# @default -- `[]` (See [values.yaml])
|
||||||
## This function in tech preview stage, do expect unstability or breaking changes in newer versions. Bump image.tag if necessary.
|
## 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
|
## Ref: https://github.com/argoproj-labs/argocd-extensions
|
||||||
extensions:
|
extensions: []
|
||||||
[]
|
|
||||||
# - name: example
|
# - name: example
|
||||||
# namespace: argocd
|
# namespace: argocd
|
||||||
# additionalLabels: {}
|
# additionalLabels: {}
|
||||||
|
|
Loading…
Reference in a new issue