Context
I deployed an application on a Kubernetes cluster using Helm and ArgoCD. ArgoCD is tasked with monitoring a GitLab repo (called manifests) which contains the Helm chart and application config. As soon as a new config is pushed to GitLab, the healthy ArgoCD application kicks in and deploys the latest config.
Goal
In addition to the GitLab repository, I also want ArgoCD to monitor two docker-hub registries, della/backend and della/frontend (both of which are being used by the ArgoCD application). In particular, I want to monitor the :latest tag of the images, and as soon as a pipeline pushes an image with that tag (to either of those registries), I want ArgoCD to deploy that image. The registries are public already.
Not a Goal
Updating the Git repository itself, or any kind of Git write back. The Git manifest repository only specifies the latest and the rest should be taken care of by ArgoCD.
Current Solution
I have set up ArgoCD image updater using this command
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/master/manifests/install.yaml
Then I am using the following application manifest.
# This is the file used by argocd.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
argocd-image-updater.argoproj.io/image-list: backend=della/backend, frontend=della/frontend
argocd-image-updater.argoproj.io/yourtool.update-strategy: latest
name: encrypt-decrypt
namespace: argocd
spec:
project: default
source:
repoURL: https://gitlab.com/della/webapp.git # Must be made available via argocd CLI
targetRevision: master # The branch
path: ./ # Subdirectory where Chart.yaml is located
destination:
server: https://kubernetes.default.svc
namespace: webapp # Every resource will be created in this app specific namespace
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true # Reconcile manual application of kubectl against the gitlab
prune: true # Rename or delete components if they are deleted in the gitlab
Result
Working
Monitoring the GitLab repository for git push. The application is healthy, and always synchronises as soon as there is a push.
Not Working
The Image Updater to watch the repositories. I am pushing docker images with the :latest tag, but ArgoCD does not react at all. Even the GUI does not have any indication it is monitoring the dockerhub registries.
Questions
- How to get the dockerhub registry to trigger an argocd redeployment in the simplest possible manner?
- Should the Deployment manifests that use the
della/backendanddella/frontendimages be altered for the image updater, or they will stay exactly the same? - Does the GUI have any way to add or indicate whether the image monitoring is active?