Skip to content

Commit 2d13dd7

Browse files
author
Casey Morton
committed
Updated documentation
Signed-off-by: Casey Morton <[email protected]>
1 parent 5a8d3b9 commit 2d13dd7

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

docs/configuration/images.md

+82
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,88 @@ If the `<image_alias>.helm.image-spec` annotation is set, the two other
353353
annotations `<image_alias>.helm.image-name` and `<image_alias>.helm.image-tag`
354354
will be ignored.
355355

356+
## Targeting specific sources in a multi-source application
357+
358+
!!! warning "Beta Feature"
359+
Multi-source applications are currently considered a beta feature within ArgoCD, therefore ArgoCD Image Updater's support for it should be considered beta as well. For more information on this feature, please consult the [ArgoCD documentation](https://argo-cd.readthedocs.io/en/stable/user-guide/multiple_sources/).
360+
361+
Typical applications only have a single source associated with them, however with ArgoCD 2.6+ multiple sources can be specified for a single application. This can occasionally serve as an alternative to the Application of Applications pattern. This may also require the ability to limit the scope of an image update to a single source. Consider the following example of a multi-source application definition:
362+
363+
```yaml
364+
apiVersion: argoproj.io/v1alpha1
365+
kind: Application
366+
metadata:
367+
annotations:
368+
argocd-image-updater.argoproj.io/image-list: wordpress=bitnami/wordpress:6,nginx=bitnami/nginx:1.25
369+
argocd-image-updater.argoproj.io/wordpress.helm.image-name: image.repository
370+
argocd-image-updater.argoproj.io/wordpress.helm.image-tag: image.tag
371+
argocd-image-updater.argoproj.io/nginx.source-index: 1
372+
argocd-image-updater.argoproj.io/nginx.helm.image-name: image.repository
373+
argocd-image-updater.argoproj.io/nginx.helm.source-index: image.tag
374+
name: multi-source-app
375+
namespace: argocd
376+
spec:
377+
destination:
378+
namespace: guestbook
379+
server: https://kubernetes.default.svc
380+
project: default
381+
sources:
382+
- chart: wordpress
383+
repoURL: https://charts.bitnami.com/bitnami
384+
targetRevision: ^18.0.0
385+
- chart: nginx
386+
repoURL: https://charts.bitnami.com/bitnami
387+
targetRevision: ^15.0.0
388+
```
389+
390+
*Scenario:* Both of these images are controlled by the same value file variables
391+
(`image.repository` and `image.tag`) within their respective Helm charts. In the case
392+
where both the wordpress and nginx images were to be included by child applications,
393+
referenced by a single parent application (Application of Applications pattern), there
394+
would be an opportunity to control each chart values individually with separate values
395+
to be applied to each chart. This would be solved similarly in the scenario where one
396+
or more of the images are pulled in with sub-charts.
397+
398+
*Solution:* In order to properly scope the overrides for each individual helm chart in
399+
a multi-source application, the `source-index` annotation must be provided for each
400+
image as shown below.
401+
402+
```yaml
403+
apiVersion: argoproj.io/v1alpha1
404+
kind: Application
405+
metadata:
406+
annotations:
407+
argocd-image-updater.argoproj.io/image-list: wordpress=bitnami/wordpress:6,nginx=bitnami/nginx:1.25
408+
argocd-image-updater.argoproj.io/wordpress.source-index: 0
409+
argocd-image-updater.argoproj.io/wordpress.helm.image-name: image.repository
410+
argocd-image-updater.argoproj.io/wordpress.helm.image-tag: image.tag
411+
argocd-image-updater.argoproj.io/nginx.source-index: 1
412+
argocd-image-updater.argoproj.io/nginx.helm.image-name: image.repository
413+
argocd-image-updater.argoproj.io/nginx.helm.image-tag: image.tag
414+
name: multi-source-app
415+
namespace: argocd
416+
spec:
417+
destination:
418+
namespace: guestbook
419+
server: https://kubernetes.default.svc
420+
project: default
421+
sources:
422+
- chart: wordpress
423+
repoURL: https://charts.bitnami.com/bitnami
424+
targetRevision: ^18.0.0
425+
- chart: nginx
426+
repoURL: https://charts.bitnami.com/bitnami
427+
targetRevision: ^15.0.0
428+
```
429+
430+
The general syntax for the `source-index` annotation is:
431+
```yaml
432+
argocd-image-updater.argoproj.io/<image_alias>.source-index: <index of the source which the image specification should apply>
433+
```
434+
!!!note
435+
The value of the `source-index` annotation is 0-based, meaning that the first source would be `0`, the second
436+
would be `1`, and so on.
437+
356438
## Examples
357439

358440
### Following an image's patch branch

0 commit comments

Comments
 (0)