Skip to content

Commit 77dad4a

Browse files
authored
Merge pull request #1185 from rackerlabs/update-argo-workflows-more
docs: provide details on how to override components and update Argo Workflows
2 parents 8f7f1d2 + e12ca41 commit 77dad4a

File tree

8 files changed

+115
-46
lines changed

8 files changed

+115
-46
lines changed

apps/site/argo-workflows.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ component: argo
33
sources:
44
- ref: understack
55
path: 'components/argo-workflows'
6-
- ref: deploy
7-
path: '{{.name}}/manifests/argo-workflows'

components/argo-workflows/sso

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,5 @@ scopes:
2222
- groups
2323
- email
2424
- profile
25-
# RBAC Config. >= v2.12
2625
rbac:
2726
enabled: false
28-
# Skip TLS verify, not recommended in production environments. Useful for testing purposes. >= v3.2.4
29-
insecureSkipVerify: true
Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,17 @@
1-
# Adding / Removing Applications
1+
# Adding / Removing Components
22

3-
The applications that are deployed using [ArgoCD][argocd]'s
3+
UnderStack **Components** are deployed via [ArgoCD]
4+
as [Applications][argocd-app], these are generated using [ArgoCD][argocd]'s
45
[ApplicationSet][argocd-appset] controller. This allows us to use common
5-
patterns to deploy each of the applications and allow specific environments
6-
to modify or disable some applications.
6+
patterns to deploy each of the components and allow specific environments
7+
to modify or disable some components. See the [Configuring Components](./component-config.md)
8+
guide for more info on how to do so.
79

8-
## Modifying an application
10+
## Adding a Component to UnderStack
911

10-
To create an environment specific modification to an application you must
11-
first determine if it's being deployed with Helm or Kustomize.
12-
13-
### Helm
14-
15-
Most of the applications can have their Helm values overridden by adding
16-
or modifying `$DEPLOY_NAME/helm-configs/$APPLICATION.yaml` in your deployment
17-
repo.
18-
19-
### Kustomize
20-
21-
To make changes you will need to add or modify files in `$DEPLOY_NAME/manifests/$APPLICATION/`
22-
in your deployment repo.
23-
24-
## Removing an application for a specific deploy
25-
26-
To remove an application from being deployed, create an `apps.yaml` file in your deployment
27-
repo at `$DEPLOY_NAME/apps.yaml`). The `apps.yaml` file
28-
contains a list of objects, where each object has a `component` field that is the name
29-
of the component (app) and an optional `skip` field that can be set to `true`:
30-
31-
```yaml
32-
- component: metallb
33-
skip: true
34-
- component: dex
35-
skip: false # optional, defaults to false
36-
```
37-
38-
## Adding an application to UnderStack
39-
40-
Adding an application to UnderStack involves deciding on the correct ApplicationSet
12+
Adding a Component to UnderStack involves deciding on the correct ApplicationSet
4113
(AppSet) to include it in, then going to that AppSet's directory in `apps/<appset>/`
42-
and adding a YAML file which contains the application configuration.
14+
and adding a YAML file which contains the Application configuration.
4315

4416
The YAML file should contain:
4517

@@ -80,9 +52,10 @@ sources:
8052
8153
## Removing an application from UnderStack
8254
83-
Removing an application permanently from UnderStack is as easy as
55+
Removing a Component permanently from UnderStack is as easy as
8456
deleting its YAML config from its AppSet in the `apps/<appset>/`
8557
directory.
8658

8759
[argocd]: <https://argo-cd.readthedocs.io/en/stable/>
60+
[argocd-app]: <https://argo-cd.readthedocs.io/en/stable/user-guide/application-specification/>
8861
[argocd-appset]: <https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Configuring Components
2+
3+
The term **Component** in UnderStack is analogous to an [Application][argocd-app] in [ArgoCD][argocd].
4+
It is typically tied to one Helm chart or Kustomize deployment. So OpenStack
5+
Keystone is a **Component** in UnderStack, which lives in `components/keystone`
6+
in the source tree. In some cases, like OpenStack services,
7+
there are shared resources so UnderStack will have another **Component** called
8+
openstack, which lives in `components/openstack` in the source tree, which
9+
other OpenStack services depend on.
10+
11+
There are three different ways to alter the configuration of a **Component**
12+
which depends on what you need to achieve.
13+
14+
1. Altering how and what ArgoCD deploys to the cluster
15+
2. Altering the Helm values or Kustomize overlays
16+
3. Altering state used by the containers that have been deployed
17+
18+
## Modifying the deployment
19+
20+
In your deployment repo, you will have `$DEPLOY_NAME/apps.yaml`
21+
(see [Deploy Repo](./deploy-repo.md) for more details) which is
22+
a list of objects, each object maps to one **Component** and must have
23+
a field `component` with the string value matching an existing component.
24+
25+
### Disabling a component
26+
27+
To disable for example the `metallb` **Component** you would add to your
28+
`apps.yaml` something like:
29+
30+
```yaml title="$DEPLOY_NAME/apps.yaml"
31+
- component: metallb
32+
skip: true
33+
```
34+
35+
The `skip` field is optional and assumed to be `false` otherwise but
36+
if set to `true` will prevent ArgoCD from deploying it.
37+
38+
### Changing sources used by ArgoCD
39+
40+
We utilize [ArgoCD][argocd] [ApplicationSets][argocd-appset] to create
41+
the [ArgoCD][argocd] [Applications][argocd-app].
42+
In all cases we default the template to being a multi-source `Application`.
43+
You can modify the sources that are used by default by editing your `$DEPLOY_NAME/apps.yaml`
44+
To change this set your own `sources` list for the **Component** you wish to
45+
modify. There are two special cased sources available which automatically
46+
set the `repoUrl` and `targetRevision` fields which are the UnderStack repo
47+
and your own deployment repo. These can be used by having a `ref` field with
48+
the value `understack` or `deploy` respectively.
49+
50+
```yaml title="$DEPLOY_NAME/apps.yaml"
51+
- component: argo
52+
sources:
53+
- ref: deploy
54+
path: deploy_name/manifests/argo-workflows
55+
```
56+
57+
The above would replace the default behavior to only source from your
58+
deployment repo for the `argo` **Component** from the specified path.
59+
60+
Another example would be:
61+
62+
```yaml title="$DEPLOY_NAME/apps.yaml"
63+
- component: openstack
64+
sources:
65+
- ref: understack
66+
path: component/openstack
67+
helm:
68+
valueFiles:
69+
- $deploy/deploy_name/helm-configs/openstack.yaml
70+
- ref: deploy
71+
```
72+
73+
This would utilize the Helm chart in the UnderStack repo while using the
74+
values file from your deployment repo. This configuration is actually what
75+
the default for this **Component** is.
76+
77+
You can see the defaults by looking in the `apps` directory in the UnderStack
78+
repo under the `global`, `site`, and `openstack` directories.
79+
80+
## Modifying component Helm values or Kustomize
81+
82+
To create an environment specific modification to an **Component** you must
83+
first determine if it's being deployed with Helm or Kustomize.
84+
85+
### Helm
86+
87+
Most of the applications can have their Helm values overridden by adding
88+
or modifying `$DEPLOY_NAME/helm-configs/$COMPONENT.yaml` in your deployment
89+
repo.
90+
91+
### Kustomize
92+
93+
To make changes you will need to add or modify files in `$DEPLOY_NAME/manifests/$COMPONENT/`
94+
in your deployment repo.
95+
96+
## Modifying Environment State
97+
98+
TODO: more to come
99+
100+
[argocd]: <https://argo-cd.readthedocs.io/en/stable/>
101+
[argocd-app]: <https://argo-cd.readthedocs.io/en/stable/user-guide/application-specification/>
102+
[argocd-appset]: <https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/>

docs/deploy-guide/config-argo-workflows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
2020
kind: Kustomization
2121

2222
resources:
23+
- https://github.com/rackerlabs/understack.git//components/argo-workflows/?ref=$TAG_OR_main_OR_OTHER_REF
2324
- ingress.yaml
2425

2526
configMapGenerator:

docs/deploy-guide/extra-sites.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ place it where we've cloned understack. A complete file would look like:
2727
# this can remain as the literal value and will ensure it computes the right path
2828
UC_DEPLOY="$(cd "$(dirname ${BASH_SOURCE[0]})" && git rev-parse --show-toplevel)"
2929
DEPLOY_NAME="my-site"
30-
DNS_ZONE=home.lab
3130
UC_DEPLOY_EMAIL="my@email"
3231
NO_ARGOCD=yes
3332
```
@@ -69,7 +68,6 @@ metadata:
6968
uc_repo_ref: HEAD
7069
uc_deploy_git_url: "${UC_DEPLOY_GIT_URL}"
7170
uc_deploy_ref: HEAD
72-
dns_zone: "${DNS_ZONE}"
7371
labels:
7472
argocd.argoproj.io/secret-type: cluster
7573
type: Opaque

go/understackctl/cmd/argocd/templates/argoSecretDeployRepo.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ metadata:
1616
uc_repo_ref: "HEAD"
1717
uc_deploy_git_url: "{{ .UC_DEPLOY_GIT_URL }}"
1818
uc_deploy_ref: "HEAD"
19-
dns_zone: "{{ .DNS_ZONE }}"

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ nav:
128128
- Quick Start: deploy-guide/gitops-install.md
129129
- Preparing Our Deployment:
130130
- deploy-guide/deploy-repo.md
131+
- deploy-guide/component-config.md
131132
- deploy-guide/auth.md
132133
- deploy-guide/config-argo-workflows.md
133134
- Starting the Deployment:

0 commit comments

Comments
 (0)