Skip to content

Commit 5c5be63

Browse files
authored
Merge pull request #384 from rackerlabs/re-order-for-view
chore: standardize and document how AppSets define apps PUC-603
2 parents 98ddb42 + 6c6af06 commit 5c5be63

File tree

5 files changed

+97
-58
lines changed

5 files changed

+97
-58
lines changed

apps/appsets/components.yaml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ spec:
2020
- component: dex
2121
skipComponent: '{{has "dex" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
2222
sources:
23+
- repoURL: https://charts.dexidp.io
24+
chart: dex
25+
targetRevision: 0.16.0
26+
helm:
27+
releaseName: dex
28+
valuesObject:
29+
config:
30+
issuer: 'https://dex.{{index .metadata.annotations "dns_zone" }}'
31+
env:
32+
DNS_ZONE: '{{index .metadata.annotations "dns_zone" }}'
33+
valueFiles:
34+
- $understack/components/dex/values.yaml
35+
- $deploy/{{.name}}/helm-configs/dex.yaml
36+
ignoreMissingValueFiles: true
2337
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
2438
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
2539
path: 'components/dex'
@@ -43,20 +57,6 @@ spec:
4357
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
4458
ref: deploy
4559
path: '{{.name}}/manifests/dex'
46-
- repoURL: https://charts.dexidp.io
47-
chart: dex
48-
targetRevision: 0.16.0
49-
helm:
50-
releaseName: dex
51-
valuesObject:
52-
config:
53-
issuer: 'https://dex.{{index .metadata.annotations "dns_zone" }}'
54-
env:
55-
DNS_ZONE: '{{index .metadata.annotations "dns_zone" }}'
56-
valueFiles:
57-
- $understack/components/dex/values.yaml
58-
- $deploy/{{.name}}/helm-configs/dex.yaml
59-
ignoreMissingValueFiles: true
6060
- component: openstack
6161
skipComponent: '{{has "openstack" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
6262
sources:
@@ -78,14 +78,6 @@ spec:
7878
- component: nautobot
7979
skipComponent: '{{has "nautobot" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
8080
sources:
81-
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
82-
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
83-
path: 'components/nautobot'
84-
ref: understack
85-
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
86-
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
87-
ref: deploy
88-
path: '{{.name}}/manifests/nautobot'
8981
- repoURL: https://nautobot.github.io/helm-charts/
9082
chart: nautobot
9183
targetRevision: 2.1.3
@@ -106,6 +98,14 @@ spec:
10698
# until ArgoCD 2.13.0 is released we cannot use a reference
10799
# path: $understack/components/nautobot/nautobot_config.py
108100
path: 'https://raw.githubusercontent.com/rackerlabs/understack/{{index .metadata.annotations "uc_repo_ref" }}/components/nautobot/nautobot_config.py'
101+
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
102+
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
103+
path: 'components/nautobot'
104+
ref: understack
105+
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
106+
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
107+
ref: deploy
108+
path: '{{.name}}/manifests/nautobot'
109109
- component: argo
110110
skipComponent: '{{has "argo" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
111111
source:
@@ -191,12 +191,6 @@ spec:
191191
componentNamespace: monitoring
192192
skipComponent: '{{has "openstack-exporter" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
193193
sources:
194-
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
195-
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
196-
ref: understack
197-
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
198-
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
199-
ref: deploy
200194
- repoURL: registry.scs.community/openstack-exporter
201195
chart: prometheus-openstack-exporter
202196
targetRevision: 0.4.5
@@ -205,6 +199,12 @@ spec:
205199
valueFiles:
206200
- $deploy/{{.name}}/helm-configs/openstack-exporter.yaml
207201
ignoreMissingValueFiles: true
202+
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
203+
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
204+
ref: understack
205+
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
206+
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
207+
ref: deploy
208208
selector:
209209
# by setting the key in the elements 'skipComponent' to 'true' it will skip installing it
210210
# ArgoCD's templating operates with strings so it's the string "true"

apps/appsets/infra.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ spec:
5353
- component: ingress-nginx
5454
skipComponent: '{{has "ingress-nginx" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
5555
sources:
56-
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
57-
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
58-
ref: deploy
5956
- repoURL: https://kubernetes.github.io/ingress-nginx
6057
chart: ingress-nginx
6158
targetRevision: 4.9.1
@@ -64,13 +61,13 @@ spec:
6461
valueFiles:
6562
- $deploy/{{.name}}/helm-configs/ingress-nginx.yaml
6663
ignoreMissingValueFiles: true
64+
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
65+
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
66+
ref: deploy
6767
- component: provisioning-ingress-nginx
6868
componentNamespace: ingress-nginx
6969
skipComponent: '{{has "provisioning-ingress-nginx" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
7070
sources:
71-
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
72-
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
73-
ref: deploy
7471
- repoURL: https://kubernetes.github.io/ingress-nginx
7572
chart: ingress-nginx
7673
targetRevision: 4.9.1
@@ -88,6 +85,9 @@ spec:
8885
valueFiles:
8986
- $deploy/{{.name}}/helm-configs/provisioning-ingress-nginx.yaml
9087
ignoreMissingValueFiles: true
88+
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
89+
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
90+
ref: deploy
9191
- component: cilium
9292
skipComponent: '{{has "cilium" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
9393
sources:

apps/appsets/openstack.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ spec:
3838
spec:
3939
project: default
4040
sources:
41-
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
42-
path: components/{{.component}}/
43-
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
44-
ref: understack
45-
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
46-
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
47-
path: '{{.name}}/manifests/{{.component}}'
48-
ref: deploy
4941
- repoURL: https://tarballs.opendev.org/openstack/openstack-helm/
5042
chart: '{{.component}}'
5143
targetRevision: '{{.chartVersion}}'
@@ -58,6 +50,14 @@ spec:
5850
- $deploy/{{.name}}/helm-configs/{{.component}}.yaml
5951
# don't require all the values files
6052
ignoreMissingValueFiles: true
53+
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
54+
path: components/{{.component}}/
55+
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
56+
ref: understack
57+
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
58+
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
59+
path: '{{.name}}/manifests/{{.component}}'
60+
ref: deploy
6161
ignoreDifferences:
6262
- kind: Secret
6363
name: keystone-fernet-keys

apps/appsets/operators.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ spec:
2020
componentNamespace: rook-ceph
2121
skipComponent: '{{has "rook" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
2222
sources:
23-
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
24-
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
25-
path: 'operators/rook'
26-
ref: understack
27-
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
28-
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
29-
ref: deploy
3023
- repoURL: https://charts.rook.io/release
3124
chart: rook-ceph
3225
targetRevision: v1.15.0
@@ -45,6 +38,13 @@ spec:
4538
- $understack/operators/rook/values-cluster.yaml
4639
- $deploy/{{.name}}/helm-configs/rook-cluster.yaml
4740
ignoreMissingValueFiles: true
41+
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
42+
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
43+
path: 'operators/rook'
44+
ref: understack
45+
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
46+
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
47+
ref: deploy
4848
- component: cnpg-system
4949
skipComponent: '{{has "cnpg-system" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
5050
sources:
@@ -70,16 +70,8 @@ spec:
7070
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
7171
path: 'operators/rabbitmq-system'
7272
- component: monitoring
73-
componentNamespace: monitoring
7473
skipComponent: '{{has "monitoring" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
7574
sources:
76-
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
77-
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
78-
path: 'operators/monitoring'
79-
ref: understack
80-
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
81-
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
82-
ref: deploy
8375
- repoURL: https://prometheus-community.github.io/helm-charts
8476
chart: kube-prometheus-stack
8577
targetRevision: 62.6.0
@@ -89,6 +81,13 @@ spec:
8981
- $understack/operators/monitoring/values.yaml
9082
- $deploy/{{.name}}/helm-configs/monitoring.yaml
9183
ignoreMissingValueFiles: true
84+
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
85+
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
86+
path: 'operators/monitoring'
87+
ref: understack
88+
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
89+
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
90+
ref: deploy
9291
selector:
9392
# by setting the key in the elements 'skipComponent' to 'true' it will skip installing it
9493
# ArgoCD's templating operates with strings so it's the string "true"

docs/deploy-guide/add-remove-app.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,47 @@ uc_skip_components: |
3636
## Adding an application to UnderStack
3737
3838
Adding an application to be part of UnderStack involves modifying the
39-
`apps/appsets/*.yaml` file that is appropriate for what you are
39+
`apps/appsets/*.yaml` file that is appropriate for what you are attempting to add.
40+
41+
The general form should be:
42+
43+
```yaml
44+
# list item per ArgoCD Application
45+
# the component value will appear as the ArgoCD Application name
46+
- component: dex
47+
# the below line can be added to install this into a different namespace than the component
48+
# componentNamespace: dex-system
49+
# this allows this component to not be installed
50+
skipComponent: '{{has "dex" ((default "[]" (index .metadata.annotations "uc_skip_components") | fromJson))}}'
51+
# defines all the sources used, the upstream chart or upstream source should come first
52+
# uc_repo_ in this context is the understack repo
53+
# uc_deploy_ in this context is the deploy specific repo
54+
sources:
55+
- repoURL: https://charts.dexidp.io
56+
chart: dex
57+
targetRevision: 0.16.0
58+
helm:
59+
releaseName: dex
60+
valueFiles:
61+
# this pulls defaults from the understack repo
62+
- $understack/components/dex/values.yaml
63+
# this pulls overrides from your deploy repo
64+
- $deploy/{{.name}}/helm-configs/dex.yaml
65+
# this makes it so the above don't have to exist
66+
ignoreMissingValueFiles: true
67+
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
68+
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
69+
# path should only be here if you have manifests you want loaded
70+
path: 'components/dex'
71+
# ref is used above in the chart for the valueFiles
72+
ref: understack
73+
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
74+
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
75+
# ref is used in the chart valueFiles
76+
ref: deploy
77+
# only needed if manifests should be here
78+
path: '{{.name}}/manifests/dex'
79+
```
4080

4181
## Removing an application from UnderStack
4282

0 commit comments

Comments
 (0)