Loading...
Loading...
Automate container image updates for Kubernetes workloads managed by Argo CD. USE WHEN configuring ArgoCD Image Updater, setting up automatic image updates, configuring update strategies (semver, digest, newest-build, alphabetical), implementing git write-back, troubleshooting image update issues, or working with ImageUpdater CRDs. Covers installation, configuration, authentication, and best practices.
npx skill4agent add julianobarbosa/claude-code-skills argocd-image-updaterkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/stable/config/install.yamlhelm repo add argo https://argoproj.github.io/argo-helm
helm install argocd-image-updater argo/argocd-image-updater -n argocd| Strategy | Description | Use Case |
|---|---|---|
| Semantic versioning with constraints | Production apps with version control |
| Most recently built image | CI/CD pipelines, dev environments |
| Track mutable tags via SHA digest | When using |
| Lexical sort (CalVer, custom schemes) | Calendar versioning, custom schemes |
| Method | Description | Persistence |
|---|---|---|
| Updates via Argo CD API (default) | Pseudo-persistent (survives restarts) |
| Commits changes to Git repository | Permanent (requires Argo CD v2.0+) |
apiVersion: argocd-image-updater.argoproj.io/v1alpha1
kind: ImageUpdater
metadata:
name: my-image-updater
namespace: argocd
spec:
namespace: argocd
commonUpdateSettings:
updateStrategy: "semver"
forceUpdate: false
applicationRefs:
- namePattern: "my-app-*"
images:
- alias: "myimage"
imageName: "myregistry/myimage"spec:
applicationRefs:
- namePattern: "production-*"
images:
- alias: "app"
imageName: "myregistry/app:1.x"
commonUpdateSettings:
updateStrategy: "semver"1.x1.*1.2.x>=1.0.0 <2.0.0~1.2.3^1.2.3spec:
applicationRefs:
- namePattern: "dev-*"
images:
- alias: "app"
imageName: "myregistry/app"
commonUpdateSettings:
updateStrategy: "newest-build"latestspec:
applicationRefs:
- namePattern: "staging-*"
images:
- alias: "app"
imageName: "myregistry/app:latest"
commonUpdateSettings:
updateStrategy: "digest"spec:
applicationRefs:
- namePattern: "calver-*"
images:
- alias: "app"
imageName: "myregistry/app"
commonUpdateSettings:
updateStrategy: "alphabetical"apiVersion: argocd-image-updater.argoproj.io/v1alpha1
kind: ImageUpdater
metadata:
name: my-image-updater
namespace: argocd
spec:
namespace: argocd
writeBackConfig:
method: "git"
gitConfig:
repository: "git@github.com:myorg/myrepo.git"
branch: "main"
writeBackTarget: "helmvalues:./values.yaml"
applicationRefs:
- namePattern: "my-app-*"
images:
- alias: "nginx"
imageName: "nginx:1.20"
manifestTargets:
helm:
name: "image.repository"
tag: "image.tag"| Target | Description |
|---|---|
| Default, creates parameter override file |
| Updates kustomization.yaml |
| Updates specified Helm values file |
apiVersion: v1
kind: Secret
metadata:
name: docker-registry-secret
namespace: argocd
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: <base64-encoded-docker-config>spec:
registries:
- name: myregistry
prefix: myregistry.example.com
credentials: pullsecret:argocd/docker-registry-secretapiVersion: v1
kind: Secret
metadata:
name: git-creds
namespace: argocd
type: Opaque
stringData:
username: git
password: <your-token-or-password>metadata:
annotations:
argocd-image-updater.argoproj.io/image-list: myimage=myregistry/myimage
argocd-image-updater.argoproj.io/myimage.update-strategy: semver
argocd-image-updater.argoproj.io/myimage.allow-tags: regexp:^[0-9]+\.[0-9]+\.[0-9]+$
argocd-image-updater.argoproj.io/write-back-method: gitkubectl logs -n argocd -l app.kubernetes.io/name=argocd-image-updater -fkubectl rollout restart deployment argocd-image-updater -n argocdkubectl get applications -n argocd -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.annotations.argocd-image-updater\.argoproj\.io/image-list}{"\n"}{end}'kubectl get imageupdaters -n argocd
kubectl describe imageupdater <name> -n argocd# Check Image Updater status
kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-image-updater
# View detailed logs
kubectl logs -n argocd deployment/argocd-image-updater --tail=100
# Check ImageUpdater CR status
kubectl get imageupdater -n argocd -o yamlspec.namespacespec:
namespace: argocd # Only discover Applications in argocd namespace# Option 1: Deploy separate ImageUpdater CRs per namespace
apiVersion: argocd-image-updater.argoproj.io/v1alpha1
kind: ImageUpdater
metadata:
name: team-a-updater
namespace: argocd
spec:
namespace: team-a-apps # Scope to team-a's Application namespace
applicationRefs:
- namePattern: "*"
---
apiVersion: argocd-image-updater.argoproj.io/v1alpha1
kind: ImageUpdater
metadata:
name: team-b-updater
namespace: argocd
spec:
namespace: team-b-apps # Scope to team-b's Application namespaceargocdpullsecret:NAMESPACE/SECRET-NAME# Example: Grant secrets access in team-a namespace
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: image-updater-secrets
namespace: team-a # Target namespace with secrets
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: secret-reader
subjects:
- kind: ServiceAccount
name: argocd-image-updater
namespace: argocd # ImageUpdater's namespacereferences/