-
Notifications
You must be signed in to change notification settings - Fork 0
feat: platform ApplicationSet + kargo charts #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9534db2
feat: platform ApplicationSet + kargo/kargo-pipelines charts
jonathandieu 16a53e2
fix(kargo): provide admin credentials via ExternalSecret
jonathandieu 4c4a3fe
fix(kargo-pipelines): Warehouse.spec.interval is required by the CRD …
jonathandieu 71d2432
fix: correct kargo-pipelines to target real apps/clusters, address Co…
jonathandieu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,53 @@ | ||
| apiVersion: argoproj.io/v1alpha1 | ||
| kind: ApplicationSet | ||
| metadata: | ||
| name: platform | ||
| namespace: argocd | ||
| spec: | ||
| goTemplate: true | ||
| generators: | ||
| - matrix: | ||
| generators: | ||
| - clusters: | ||
| selector: | ||
| matchLabels: | ||
| purpose: platform | ||
| - list: | ||
| elements: | ||
| - app: kargo | ||
| namespace: kargo | ||
| wave: "0" | ||
| - app: kargo-pipelines | ||
| namespace: kargo | ||
| wave: "1" | ||
| template: | ||
| metadata: | ||
| name: "{{ .app }}-{{ .name }}" | ||
| annotations: | ||
| argocd.argoproj.io/sync-wave: "{{ .wave }}" | ||
| spec: | ||
| project: default | ||
| sources: | ||
| - repoURL: https://github.com/jonathandieu/dieubernetes | ||
| targetRevision: HEAD | ||
| ref: values | ||
| - repoURL: https://github.com/jonathandieu/dieubernetes | ||
| targetRevision: HEAD | ||
| path: "charts/platform/{{ .app }}" | ||
| helm: | ||
| releaseName: "{{ .app }}" | ||
| valueFiles: | ||
| - values.yaml | ||
| - "$values/clusters/{{ .name }}/overrides/{{ .app }}.yaml" | ||
| ignoreMissingValueFiles: true | ||
| destination: | ||
| server: "{{ .server }}" | ||
| namespace: "{{ .namespace }}" | ||
| syncPolicy: | ||
| automated: | ||
| prune: true | ||
| selfHeal: true | ||
| syncOptions: | ||
| - CreateNamespace=true | ||
| - ServerSideApply=true | ||
|
Copilot marked this conversation as resolved.
|
||
| - SkipDryRunOnMissingResource=true | ||
This file contains hidden or 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,4 @@ | ||
| apiVersion: v2 | ||
| name: kargo-pipelines | ||
| description: Kargo Warehouses and Stages for all workload apps | ||
| version: 0.1.0 |
This file contains hidden or 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,70 @@ | ||
| {{- range $envName, $env := .Values.environments }} | ||
| {{- range $.Values.apps }} | ||
| {{- $app := . }} | ||
| --- | ||
| apiVersion: kargo.akuity.io/v1alpha1 | ||
| kind: Stage | ||
| metadata: | ||
| name: {{ $app.name }}-{{ $envName }} | ||
| namespace: {{ $.Release.Namespace }} | ||
| spec: | ||
| requestedFreight: | ||
| - origin: | ||
| kind: Warehouse | ||
| name: {{ $app.name }} | ||
| sources: | ||
| {{- if eq $envName "stage" }} | ||
| direct: true | ||
| {{- else }} | ||
| # prod only receives freight already verified in stage — one Stage | ||
| # per environment, not per cluster, so this is a single reference | ||
| # regardless of how many clusters are in the stage environment. | ||
| stages: | ||
| - {{ $app.name }}-stage | ||
| {{- end }} | ||
|
Comment on lines
+15
to
+24
|
||
| promotionTemplate: | ||
| spec: | ||
| steps: | ||
| - uses: git-clone | ||
| config: | ||
| repoURL: {{ $.Values.git.repoURL }} | ||
| checkout: | ||
| - branch: {{ $.Values.git.branch }} | ||
| path: ./repo | ||
|
|
||
| # Update image tag in every cluster override file for this environment. | ||
| # When a new cluster is added to environments.{{ $envName }}.clusters, | ||
| # its override file is automatically included here on next ArgoCD sync. | ||
| {{- range $env.clusters }} | ||
| - uses: git-update-image | ||
| as: update-{{ . }} | ||
| config: | ||
| path: ./repo | ||
| images: | ||
| - image: {{ $app.imageRepo }} | ||
| fromFreight: true | ||
| updates: | ||
| - file: clusters/{{ . }}/overrides/{{ $app.name }}.yaml | ||
| key: "{{ $app.imageValueKey }}" | ||
| {{- end }} | ||
|
Comment on lines
+38
to
+49
|
||
|
|
||
| - uses: git-commit | ||
| config: | ||
| path: ./repo | ||
| message: "chore(kargo): promote {{ $app.name }} to {{ $envName }}" | ||
|
|
||
| - uses: git-push | ||
| config: | ||
| path: ./repo | ||
|
|
||
| # Trigger ArgoCD sync for every cluster in this environment | ||
| {{- range $env.clusters }} | ||
| - uses: argocd-update | ||
| config: | ||
| apps: | ||
| - name: {{ $app.name }}-{{ . }} | ||
| sources: | ||
| - desiredCommitFromStep: git-push | ||
| {{- end }} | ||
|
Comment on lines
+60
to
+68
|
||
| {{- end }} | ||
| {{- end }} | ||
This file contains hidden or 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,15 @@ | ||
| {{- range .Values.apps }} | ||
| --- | ||
| apiVersion: kargo.akuity.io/v1alpha1 | ||
| kind: Warehouse | ||
| metadata: | ||
| name: {{ .name }} | ||
| namespace: {{ $.Release.Namespace }} | ||
| spec: | ||
|
Copilot marked this conversation as resolved.
|
||
| interval: 5m0s | ||
| subscriptions: | ||
| - image: | ||
| repoURL: {{ .imageRepo }} | ||
| semverConstraint: ">=0.0.0" | ||
| discoveryLimit: 5 | ||
| {{- end }} | ||
This file contains hidden or 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,34 @@ | ||
| # environments lists which clusters belong to each Kargo Stage, using the | ||
| # short cluster name ArgoCD's cluster secret uses (matches the | ||
| # clusters/<name>/overrides/ directories the workloads appset reads from — | ||
| # not the full dieubernetes-{tier}-{provider}-{region} workspace name). | ||
| # `dieuctl cluster create --environment stage` appends to the stage list. | ||
| # `dieuctl cluster destroy` removes the cluster from its environment list. | ||
| # ArgoCD syncs the updated Kargo Stage definitions automatically. | ||
| environments: | ||
| stage: | ||
| clusters: | ||
| - stage-do-atl1 | ||
| prod: | ||
| clusters: | ||
| - prod-do-atl1 | ||
|
|
||
| # apps lists every workload app that goes through the Kargo pipeline — each | ||
| # must have a real chart under charts/workloads/. imageValueKey is the path | ||
| # to the image tag in that chart's own values (relative to the chart root, | ||
| # since override files are merged directly as the chart's values) — it | ||
| # varies for umbrella charts that wrap an aliased subchart. | ||
| apps: | ||
| - name: mealie | ||
| imageRepo: ghcr.io/mealie-recipes/mealie | ||
| imageValueKey: image.tag | ||
| - name: plausible | ||
| imageRepo: ghcr.io/plausible/community-edition | ||
| imageValueKey: plausible-analytics.image.tag | ||
| - name: changedetection | ||
| imageRepo: ghcr.io/dgtlmoon/changedetection.io | ||
| imageValueKey: image.tag | ||
|
|
||
| git: | ||
| repoURL: https://github.com/jonathandieu/dieubernetes | ||
| branch: main |
This file contains hidden or 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,7 @@ | ||
| apiVersion: v2 | ||
| name: kargo | ||
| version: 0.1.0 | ||
| dependencies: | ||
| - name: kargo | ||
| version: "1.10.7" | ||
| repository: oci://ghcr.io/akuity/kargo-charts |
21 changes: 21 additions & 0 deletions
21
charts/platform/kargo/templates/kargo-admin-credentials.yaml
This file contains hidden or 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,21 @@ | ||
| apiVersion: external-secrets.io/v1 | ||
| kind: ExternalSecret | ||
| metadata: | ||
| name: kargo-admin-credentials | ||
| namespace: {{ .Release.Namespace }} | ||
| annotations: | ||
| argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
| spec: | ||
| refreshInterval: 1h | ||
| secretStoreRef: | ||
| name: onepassword | ||
| kind: ClusterSecretStore | ||
| target: | ||
| name: kargo-admin-credentials | ||
| data: | ||
| - secretKey: ADMIN_ACCOUNT_PASSWORD_HASH | ||
| remoteRef: | ||
| key: fhygr5davlgoiugn3oggxovcte/password_hash | ||
| - secretKey: ADMIN_ACCOUNT_TOKEN_SIGNING_KEY | ||
| remoteRef: | ||
| key: fhygr5davlgoiugn3oggxovcte/token_signing_key |
This file contains hidden or 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,9 @@ | ||
| kargo: | ||
| api: | ||
| adminAccount: | ||
| enabled: true | ||
| secret: | ||
| name: kargo-admin-credentials # created by templates/kargo-admin-credentials.yaml, sourced from the "Kargo Admin" 1Password item | ||
| argocd: | ||
| integrationEnabled: true | ||
| namespace: argocd |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.