Skip to content
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

docs: authorizing kargo stages to modify argo apps #2921

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/docs/30-how-to-guides/25-argo-cd-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
description: Learn how to set up Argo CD to work with Kargo-managed projects.
krancour marked this conversation as resolved.
Show resolved Hide resolved
sidebar_label: Argo CD Integration
---

# Argo CD Integration

Kargo integrates seamlessly with Argo CD to facilitate a more streamlined application lifecycle management process. While Argo CD helps with deploying Kubernetes objects and synchronizing changes in the cluster, Kargo focuses on orchestrating the promotion of these changes through various `Stage`s of development, such as from `development` to `testing` and then to `production`.
krancour marked this conversation as resolved.
Show resolved Hide resolved

:::note
This page is a work in progress.
During this process, you may find limited details here. Please bear with us as we work to add more information.
krancour marked this conversation as resolved.
Show resolved Hide resolved
:::

### Authorizing Kargo `Stage`s to Modify Argo CD Applications
krancour marked this conversation as resolved.
Show resolved Hide resolved

To enable Kargo `Stage`s to interact with and modify Argo CD applications, applications need to explicitly authorize Kargo to perform these actions. This is accomplished using the `kargo.akuity.io/authorized-stage` annotation.

Kargo requires the annotation in the following format:

```yaml
kargo.akuity.io/authorized-stage: "<project-name>:<stage-name>"
```

This annotation signifies consent for Kargo to manage the application on behalf of the designated `Project` and `Stage`.
krancour marked this conversation as resolved.
Show resolved Hide resolved

In the following example, the `ApplicationSet` manifest is configured to allow Kargo management by dynamically setting the `kargo.akuity.io/authorized-stage: kargo-demo:{{stage}}` annotation for each `Stage` (`test`, `uat`, `prod`) to ensure that each `Stage` in the `kargo-demo` `Project` is authorized to modify its respective Argo CD Application:
krancour marked this conversation as resolved.
Show resolved Hide resolved

```yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: kargo-demo
namespace: argocd
spec:
generators:
- list:
elements:
- stage: test
- stage: uat
- stage: prod
template:
metadata:
name: kargo-demo-{{stage}}
annotations:
kargo.akuity.io/authorized-stage: kargo-demo:{{stage}}
spec:
# Application Specifications
krancour marked this conversation as resolved.
Show resolved Hide resolved
```