Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local
kubectl create ns argocd-e2e-external || true
kubectl create ns argocd-e2e-external-2 || true
kubectl config set-context --current --namespace=argocd-e2e
kustomize build test/manifests/base | kubectl apply -f -
kustomize build test/manifests/base | kubectl apply --server-side -f -
kubectl apply -f https://raw.githubusercontent.com/open-cluster-management/api/a6845f2ebcb186ec26b832f60c988537a58f3859/cluster/v1alpha1/0000_04_clusters.open-cluster-management.io_placementdecisions.crd.yaml
# Create GPG keys and source directories
if test -d /tmp/argo-e2e/app/config/gpg; then rm -rf /tmp/argo-e2e/app/config/gpg/*; fi
Expand Down
12 changes: 12 additions & 0 deletions assets/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions controller/hydrator/hydrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ func (h *Hydrator) getManifests(ctx context.Context, app *appv1.Application, tar
RepoURL: app.Spec.SourceHydrator.DrySource.RepoURL,
Path: app.Spec.SourceHydrator.DrySource.Path,
TargetRevision: app.Spec.SourceHydrator.DrySource.TargetRevision,
Helm: app.Spec.SourceHydrator.DrySource.Helm,
Kustomize: app.Spec.SourceHydrator.DrySource.Kustomize,
Directory: app.Spec.SourceHydrator.DrySource.Directory,
Plugin: app.Spec.SourceHydrator.DrySource.Plugin,
}
if targetRevision == "" {
targetRevision = app.Spec.SourceHydrator.DrySource.TargetRevision
Expand Down
106 changes: 106 additions & 0 deletions docs/user-guide/source-hydrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,112 @@ It is important to note that hydration only cleans the currently configured appl
If there are multiple repository-write Secrets available for a repo, the source hydrator will non-deterministically
select one of the matching Secrets and log a warning saying "Found multiple credentials for repoURL".

## Source Configuration Options

The source hydrator supports various source types through inline configuration options in the `drySource` field. This allows you to use Helm charts, Kustomize applications, directories, and plugins with environment-specific configurations.

### Helm Charts

You can use Helm charts by specifying the `helm` field in the `drySource`:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-helm-app
spec:
sourceHydrator:
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
path: helm-guestbook
targetRevision: HEAD
helm:
valueFiles:
- values-prod.yaml
parameters:
- name: image.tag
value: v1.2.3
releaseName: my-release
syncSource:
targetBranch: environments/prod
path: helm-guestbook-hydrated
```

### Kustomize Applications

For Kustomize applications, use the `kustomize` field:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-kustomize-app
spec:
sourceHydrator:
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
path: kustomize-guestbook
targetRevision: HEAD
kustomize:
namePrefix: prod-
nameSuffix: -v1
images:
- gcr.io/heptio-images/ks-guestbook-demo:0.2
syncSource:
targetBranch: environments/prod
path: kustomize-guestbook-hydrated
```

### Directory Applications

For plain directory applications with specific options, use the `directory` field:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-directory-app
spec:
sourceHydrator:
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
path: guestbook
targetRevision: HEAD
directory:
recurse: true
syncSource:
targetBranch: environments/prod
path: guestbook-hydrated
```

### Config Management Plugins

You can also use Config Management Plugins by specifying the `plugin` field:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-plugin-app
spec:
sourceHydrator:
drySource:
repoURL: https://github.com/argoproj/argocd-example-apps
path: my-plugin-app
targetRevision: HEAD
plugin:
name: my-custom-plugin
env:
- name: ENV_VAR
value: prod
syncSource:
targetBranch: environments/prod
path: my-plugin-app-hydrated
```

!!! note "Feature Parity"
The source hydrator supports the same configuration options as the regular Application source field. You can use any combination of these source types with their respective configuration options to match your application's needs.

## Pushing to a "Staging" Branch

The source hydrator can be used to push hydrated manifests to a "staging" branch instead of the `syncSource` branch.
Expand Down
Loading
Loading