Skip to content

Commit d8dcb34

Browse files
committed
feat(argocd-understack): refactor deployment directory layout
This introduces three new understackctl deploy subcommands to streamline deployment repository management. The deploy init command creates a cluster directory with a deploy.yaml configuration file that follows the ArgoCD Helm chart values structure, where each component has an individual enabled flag. Component names use underscores in the YAML to match Helm conventions. The deploy update command syncs the filesystem by creating manifests directories for enabled components and removing directories for disabled ones, automatically generating kustomization.yaml and values.yaml files in each component directory. The deploy check command validates that all required files exist for enabled components. These commands replace the manual directory creation and gitops-deploy.sh script workflow previously documented. The ArgoCD chart templates are updated to look for Helm values at manifests/component/values.yaml instead of helm-configs/component.yaml, consolidating all component configuration into a single manifests directory structure. This allows Kustomize resources and Helm values to coexist in the same component directory, simplifying the deployment repository layout. Documentation is updated throughout the deploy guide to use the new understackctl commands instead of manual mkdir and file creation steps. The gitops-deploy.sh script is deprecated with a notice directing users to the new CLI commands. A GitHub Actions workflow is added to run Go tests for all Go projects in the repository, ensuring the new deploy commands remain tested in CI.
1 parent b94b21d commit d8dcb34

51 files changed

Lines changed: 1387 additions & 235 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/go-test.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Go Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- "go/**"
8+
- .github/workflows/go-test.yaml
9+
pull_request:
10+
paths:
11+
- "go/**"
12+
- .github/workflows/go-test.yaml
13+
workflow_dispatch:
14+
merge_group:
15+
types: [checks_requested]
16+
paths:
17+
- "go/**"
18+
- .github/workflows/go-test.yaml
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
setup:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
28+
29+
- name: List Applications
30+
id: list_dirs
31+
run: |
32+
apps=$(ls -d go/* | xargs -n1 basename)
33+
app_array=$(printf '%s\n' $apps | jq -R . | jq -cs .)
34+
echo "apps=${app_array}"
35+
printf "apps=%s\n" "${app_array}" >> "$GITHUB_OUTPUT"
36+
shell: bash
37+
outputs:
38+
apps: ${{ steps.list_dirs.outputs.apps }}
39+
40+
test:
41+
runs-on: ubuntu-latest
42+
needs: setup
43+
strategy:
44+
matrix:
45+
app: ${{ fromJson(needs.setup.outputs.apps) }}
46+
steps:
47+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
48+
49+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
50+
with:
51+
go-version-file: go/${{ matrix.app }}/go.mod
52+
53+
- name: Test ${{ matrix.app }}
54+
working-directory: go/${{ matrix.app }}
55+
run: go test -v ./...

charts/argocd-understack/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Examples:
108108
deploy_path_prefix: "us/east" -> "us/east/uc-iad3-prod"
109109
110110
Usage in valueFiles:
111-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/dex.yaml
111+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/dex/values.yaml
112112
113113
Usage in source path:
114114
path: {{ include "understack.deploy_path" $ }}/manifests/dex

charts/argocd-understack/templates/application-dex.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
releaseName: dex
1919
valueFiles:
2020
- $understack/components/dex/values.yaml
21-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/dex.yaml
21+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/dex/values.yaml
2222
repoURL: https://charts.dexidp.io
2323
targetRevision: 0.16.0
2424
- path: components/dex

charts/argocd-understack/templates/application-envoy-configs.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
ignoreMissingValueFiles: true
1818
valueFiles:
1919
- $understack/components/envoy-configs/values.yaml
20-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/envoy-configs.yaml
20+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/envoy-configs/values.yaml
2121
ref: understack
2222
repoURL: {{ include "understack.understack_url" $ }}
2323
targetRevision: {{ include "understack.understack_ref" $ }}

charts/argocd-understack/templates/application-envoy-gateway.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
releaseName: gateway-helm
1919
valueFiles:
2020
- $understack/components/envoy-gateway/values.yaml
21-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/envoy-gateway.yaml
21+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/envoy-gateway/values.yaml
2222
repoURL: docker.io/envoyproxy
2323
targetRevision: v1.6.0
2424
- path: components/envoy-gateway

charts/argocd-understack/templates/application-etcdbackup.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
ignoreMissingValueFiles: true
1717
valueFiles:
1818
- $understack/components/etcdbackup/values.yaml
19-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/etcdbackup.yaml
19+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/etcdbackup/values.yaml
2020
path: components/etcdbackup
2121
ref: understack
2222
repoURL: {{ include "understack.understack_url" $ }}

charts/argocd-understack/templates/application-external-dns.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
ignoreMissingValueFiles: true
1818
releaseName: external-dns-rackspace
1919
valueFiles:
20-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/external-dns.yaml
20+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/external-dns/values.yaml
2121
repoURL: ghcr.io/rackerlabs/charts
2222
targetRevision: 0.2.0
2323
- path: {{ include "understack.deploy_path" $ }}/manifests/external-dns

charts/argocd-understack/templates/application-ingress-nginx.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
ignoreMissingValueFiles: true
1818
releaseName: ingress-nginx
1919
valueFiles:
20-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/ingress-nginx.yaml
20+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/ingress-nginx/values.yaml
2121
repoURL: https://kubernetes.github.io/ingress-nginx
2222
targetRevision: 4.12.1
2323
- ref: deploy

charts/argocd-understack/templates/application-monitoring.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
releaseName: kube-prometheus-stack
2424
valueFiles:
2525
- $understack/operators/monitoring/values.yaml
26-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/monitoring.yaml
26+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/monitoring/values.yaml
2727
repoURL: https://prometheus-community.github.io/helm-charts
2828
targetRevision: 79.5.0
2929
- path: operators/monitoring

charts/argocd-understack/templates/application-nautobot.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
releaseName: nautobot
2222
valueFiles:
2323
- $understack/components/nautobot/values.yaml
24-
- $deploy/{{ include "understack.deploy_path" $ }}/helm-configs/nautobot.yaml
24+
- $deploy/{{ include "understack.deploy_path" $ }}/manifests/nautobot/values.yaml
2525
repoURL: https://nautobot.github.io/helm-charts/
2626
targetRevision: 2.5.6
2727
- path: components/nautobot

0 commit comments

Comments
 (0)