|
| 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/> |
0 commit comments