https://github.com/jblorincz/argocd-image-updater-example
Minimum example of argocd image updater in action - hands on tutorial
https://github.com/jblorincz/argocd-image-updater-example
argocd argocd-image-updater kubernetes tutorial
Last synced: 7 months ago
JSON representation
Minimum example of argocd image updater in action - hands on tutorial
- Host: GitHub
- URL: https://github.com/jblorincz/argocd-image-updater-example
- Owner: JBLorincz
- Created: 2025-02-15T19:57:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-15T21:17:13.000Z (over 1 year ago)
- Last Synced: 2025-02-15T22:23:57.087Z (over 1 year ago)
- Topics: argocd, argocd-image-updater, kubernetes, tutorial
- Language: Smarty
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Steps to use
## Initial steps
1. Create a kubernetes cluster (minikube, microk8s, whatever you want)
2. [Install ArgoCD to that cluster](https://argo-cd.readthedocs.io/en/stable/getting_started/)
3. [Ensure you have the ArgoCD CLI](https://argo-cd.readthedocs.io/en/stable/cli_installation/)
4. [Install Argocd image updater to that cluster](https://argocd-image-updater.readthedocs.io/en/stable/install/installation/)
## Git steps
5. Create a [access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) in github with the `repo` scope and permissions to access your forked repo. Remember the token!
6. Fork this repository. ArgoCD will need a way to modify the repository itself to achieve the GitOps design. The access token will let it do that.
7. Using the Argo CLI, Register your repository like so: `argocd repo add --username accesstoken --password ` NOTE: use your access token as the password here (username can be any nonempty string). Path to your fork should look something like `https://github.com/jblorincz/argocd-image-updater-example`
8. In Argo, create a git secret with your access token to let image updater make updates.
```
kubectl -n argocd create secret generic git-creds \
--from-literal=username=accesstoken \
--from-literal=password=
```
9. Using the Argo CLI, apply the main app:
```
argocd app create apps \
--dest-namespace argocd \
--dest-server https://kubernetes.default.svc \
--repo \
--path image-updater-example
argocd app sync apps
```
10. Watch as two apps get deployed, a `develop` and a `production` app. both will spawn one pod using the `nginx:stable-alpine` tag. develop is hooked up to argo image updater, while production is not. Both pods will be using the same image at first, but wait (at least a few hours) and you will see that the develop app the image gets automatically updated as new updates are made to nginx.
11. Check for `argo-image-updater` to make a commit to your Github repo, modifying the file at `example-app/.argocd-source-develop.yaml`. This is where ArgoCD Image Updater will write the image tag to use, overriding the setting in the `values.yaml` to ensure that the image with the most recent digest is being applied for the image tag.
Read more about the ArgoCD Image Updater here: [https://argocd-image-updater.readthedocs.io/en/stable/](https://argocd-image-updater.readthedocs.io/en/stable/)