-
Notifications
You must be signed in to change notification settings - Fork 263
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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: | ||
# | ||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you replace the raw link with a link with text display? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing comments here?