You can use ArgoCD image-updater
But before using the the image-updater, you need to install and set appropriate permission
helm repo add argo https://argoproj.github.io/argo-helm
helm install argocd-image-updater argo/argocd-image-updater
Once image-updator is up and running, then you need to set a few annotations in the Argocd application, as the update workers on different strategies
semver - Update to the latest version of an image considering semantic versioning constraints
latest - Update to the most recently built image found in a registry
digest - Update to the latest version of a given version (tag), using the tag's SHA digest
name - Sorts tags alphabetically and update to the one with the highest cardinality
latest
strategies working awesome with tagging under some regex and digest
more suited for testing environment.
update-strategies
You can also pull the private image from gitlab as well.
Here is the working example with helm-release
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
argocd-image-updater.argoproj.io/image-alias.allow-tags: 'regexp:^1.3.0-SNAPSHOT.[0-9]+$'
argocd-image-updater.argoproj.io/image-alias.force-update: 'true'
argocd-image-updater.argoproj.io/image-alias.pull-secret: 'pullsecret:develop-namespace/develop-app-gitlab-secrets'
argocd-image-updater.argoproj.io/image-alias.update-strategy: latest
argocd-image-updater.argoproj.io/image-list: >-
image-alias=registry.gitlab.com/myorg/my-test-image
finalizers:
- resources-finalizer.argocd.argoproj.io
labels:
app.kubernetes.io/instance: develop-platform
name: develop-app
namespace: argocd
spec:
destination:
namespace: develop-app
server: 'https://kubernetes.default.svc'
project: develop-app-west6-b
source:
helm:
releaseName: develop-app
valueFiles:
- develop-platform/values.yaml
path: helm-chart/helm-chart
repoURL: 'https://gitlab.com/my-org/develop-app.git'
targetRevision: staging
syncPolicy:
automated:
prune: true
selfHeal: true
If you need digest
or just a latest then remove this
argocd-image-updater.argoproj.io/image-alias.allow-tags: 'regexp:^1.3.0-SNAPSHOT.[0-9]+$'
this is working base on regex.
so in your case <1.0.xxx>
it can be 'regexp:^1.0.[0-9]+$'
If everything configured properly and image updater working fine then you should be able to see logs image updater logs like this
time="2022-04-27T15:18:36Z" level=info msg="Successfully updated image 'registry.gitlab.com/test-image:0.3.0-SNAPSHOT.115' to 'registry.gitlab.com/test-image:0.3.0-SNAPSHOT.118'