Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(argocd): support applicationsets (#14496)
Co-authored-by: Rhys Arkins <rhys@arkins.net> Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
- Loading branch information
1 parent
72acc8b
commit b90584c
Showing
4 changed files
with
147 additions
and
7 deletions.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
lib/modules/manager/argocd/__fixtures__/validApplicationSet.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ApplicationSet | ||
spec: | ||
template: | ||
spec: | ||
source: | ||
chart: kube-state-metrics | ||
repoURL: https://prometheus-community.github.io/helm-charts | ||
targetRevision: 2.4.1 | ||
--- | ||
# applicationset with helm values | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ApplicationSet | ||
spec: | ||
template: | ||
spec: | ||
source: | ||
chart: {{ .Values.chart }} | ||
repoURL: {{ .Values.repoUrl}} | ||
targetRevision: {{ .Values.targetRevision }} | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ApplicationSet | ||
spec: | ||
template: | ||
spec: | ||
source: | ||
chart: traefik | ||
helm: | ||
values: | | ||
traefik: | ||
service: | ||
spec: | ||
loadBalancerIP: 1.2.3.4 | ||
repoURL: https://helm.traefik.io/traefik | ||
targetRevision: 10.14.2 | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ApplicationSet | ||
spec: | ||
template: | ||
spec: | ||
source: | ||
repoURL: https://git.example.com/foo/bar.git | ||
targetRevision: v1.2.0 | ||
--- | ||
# malformed applicationset as the source section is missing | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ApplicationSet | ||
spec: | ||
template: | ||
spec: | ||
target: | ||
namespace: testing | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ApplicationSet | ||
metadata: | ||
name: podinfo | ||
spec: | ||
generators: | ||
- clusters: {} | ||
template: | ||
metadata: | ||
name: '{{name}}-podinfo' | ||
spec: | ||
project: default | ||
source: | ||
repoURL: https://stefanprodan.github.io/podinfo | ||
targetRevision: 6.0.0 | ||
chart: podinfo | ||
destination: | ||
name: '{{server}}' | ||
namespace: podinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
export interface ApplicationDefinition { | ||
export interface KubernetesResource { | ||
apiVersion: string; | ||
} | ||
|
||
export interface ApplicationSource { | ||
chart?: string; | ||
repoURL: string; | ||
targetRevision: string; | ||
} | ||
|
||
export interface Application extends KubernetesResource { | ||
kind: 'Application'; | ||
spec: { | ||
source: ApplicationSource; | ||
}; | ||
} | ||
|
||
export interface ApplicationSet extends KubernetesResource { | ||
kind: 'ApplicationSet'; | ||
spec: { | ||
source: { | ||
chart?: string; | ||
repoURL: string; | ||
targetRevision: string; | ||
template: { | ||
spec: { | ||
source: ApplicationSource; | ||
}; | ||
}; | ||
}; | ||
} | ||
|
||
export type ApplicationDefinition = Application | ApplicationSet; |