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

Document specific workaround dedicated to ApplicationSet usage #751

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
78 changes: 78 additions & 0 deletions docs/configuration/application-sets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# ApplicationSet considerations

If using an `ApplicationSet` instead of `Application`, there are a few things to consider. Take this `ApplicationSet` manifest as example:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: vitrine
namespace: argocd
spec:
ignoreApplicationDifferences:
- jsonPointers:
- /spec/source/helm/parameters
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- matrix:
generators:
- list:
elements:
- name: vitrine
- list:
elements:
- branch: main
- branch: develop
template:
metadata:
name: "{{ printf `%s-%s` `{{ .name }}` `{{ .branch }}` }}"
namespace: argocd
annotations:
#
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing comments here?

argocd-image-updater.argoproj.io/image-list: "{{ `{{ .name }}` }}=docker.io/myuser/{{ `{{ .name }}` }}:{{ `{{ .branch }}` }}"
argocd-image-updater.argoproj.io/{{ `{{ .name }}` }}.helm.image-name: config.image.name
argocd-image-updater.argoproj.io/{{ `{{ .name }}` }}.helm.image-tag: config.image.tag
argocd-image-updater.argoproj.io/{{ `{{ .name }}` }}.update-strategy: digest
spec:
destination:
server: {{ quote .Values.spec.destination.server }}
namespace: "{{ printf `%s-%s` .Values.sharedConfig.namespaceBase `{{ .branch }}` }}"
project: default
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
source:
path: "{{ printf `%s/%s` .Values.spec.source.repo.paths.charts `{{ .name }}` }}"
repoURL: {{ include "repoNameFullName" . }}
targetRevision: HEAD
helm:
valueFiles:
- values.yaml
valuesObject:
config:
image:
name: "docker.io/myuser//{{ `{{ .name }}` }}"
tag: "{{ `{{ .branch }}` }}"
```

## Automatic patching of children `Application`s

By default, `ApplicationSet` prevents any manual modification of spawned `Application`. For example, if you try to update a child `Application` through the UI, the modification will be instantly reverted; this is an expected behavior.
Theses rejected manual modifications sadly include Image Updater's `spec.template.spec.source.helm.parameters` `Application` automatic patching, which will prevent `argocd-image-updater.argoproj.io/write-back-method: argocd` implicit behavior to function properly.

In this case, you will still receive `ImagesUpdated` events on your affected `Application`, but Image Updater will continously retry again, to no avail.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, change to "continuously"


To allow Image Updater to work here, you need to add this to your `ApplicationSet`:

```yaml
spec:
ignoreApplicationDifferences:
- jsonPointers:
- /spec/source/helm/parameters
```

This will prevent automatic revert behavior of `ApplicationSet` if any of the defined `jsonPointers` subjacent values are altered on children `Application`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"subjacent values", do you mean something like subordinate values or child values?


Please mind there are also a few caveats to consider. (see https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Controlling-Resource-Modification/#limitations-of-ignoreapplicationdifferences)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace the raw link with a link with text display?

Loading