Skip to content

feat(k8s): argo cd image updater keeps the devops application on the digest of service:latest #1485

Closed

Description

@dan-petty

Requested by the owner, 2026-10-09: "for the service image, and any other internal services where we control the lifecycle, I want to implement argocd image updater and rip out the custom process for updating service version tags completely", with the digest strategy on :latest and no git commits back to the repository. This item installs and configures it; #1486 removes the custom process in a later release, so the two never reach main in the same merge.

Problem

Checked at main (8598e79).

  • The Service image tag reaches the cluster through a custom path: the cut bumps newTag in k8s/devops/kustomization.yaml (commands/release.py _update_service_image_tag), devops release check holds that pin to the version, and release.yml publishes service:vX.Y.Z from the release branch first (fix(release): the Service image a release pins is published before main pins it, so Argo CD never rolls the roadmap Service onto a missing image #1451) so main never pins a missing image.
  • One image qualifies as an internal service whose lifecycle we control: ghcr.io/dan-petty/devops-cli/service, deployed by Application devops in the roadmap-service Deployment and the devops-cli CronJob (both name it untagged). The devcontainer image is not deployed; every other image in the cluster is third-party and pinned by tag.
  • Image Updater is not installed (no controller, no imageupdaters.argocd-image-updater.argoproj.io CRD). Argo CD runs v3.5.3 from chart 10.9.6.

Proposed design

  • An Application argocd-image-updater in k8s/argocd/apps/, from the argo-helm chart argocd-image-updater pinned to 1.3.1 (app v1.3.0, built against Argo CD 3.5), in namespace argocd, managed by the cluster app-of-apps like the other chart Applications. Image Updater talks only to the Kubernetes API and must run in the namespace of the Applications it selects (https://argocd-image-updater.readthedocs.io/en/stable/install/installation/).
  • One ImageUpdater resource (argocd-image-updater.argoproj.io/v1alpha1) in argocd:
    spec:
      applicationRefs:
      - namePattern: devops
        images:
        - alias: service
          imageName: ghcr.io/dan-petty/devops-cli/service:latest
          commonUpdateSettings:
            updateStrategy: digest
    No writeBackConfig, so the default argocd method writes service:latest@sha256:<digest> into the devops Application's spec.source.kustomize.images; nothing commits to git. The cluster app-of-apps already ignores /spec/source/kustomize on devops with RespectIgnoreDifferences=true (k8s/argocd/bootstrap/cluster.yaml), so its self-heal does not revert the write.
  • GHCR needs no credentials (the package is public), so no registries entry.
  • imagePullPolicy: IfNotPresent on both containers (the Deployment has it; the CronJob gets it). Kubernetes defaults a reference whose tag is latest to Always, even with a digest; the digest makes IfNotPresent exact and keeps a registry outage from blocking a restart.
  • Until refactor(release): the release no longer pins, bumps or pre-publishes the service image tag; image updater rolls service:latest #1486 lands, the old newTag pin stays in git; the Application override takes precedence, so there is no window in which the render is an untagged latest.

Acceptance criteria

  • The new Application pins the chart version, and a test renders the ImageUpdater resource: it selects exactly Application devops and image service:latest with strategy digest, and sets no git write-back.
  • Both workloads set imagePullPolicy: IfNotPresent.
  • A test shows deploy-stack's host merge patch (argocd_overrides.py) leaves spec.source.kustomize.images untouched.
  • k8s/README.md's GitOps section names the new Application and how to read the deployed digest (the ImageUpdater status, or spec.source.kustomize.images on Application devops).
  • After the release that carries this merges: the controller is Ready, and Application devops holds service:latest@sha256:<latest's digest> within one poll (2 min) with the pod on that digest; when the next release moves latest, the Deployment rolls within one poll with no git commit. (Person-checked in the cluster.)
  • changelog.d/<issue>.md.

Activity

  1. added
    type/feature
    scope/k8s
    on Oct 9, 2026
  2. added this to the v0.2.31 milestone on Oct 9, 2026
  3. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Placed by the owner, 2026-10-09: first in its release (#1485 in v0.2.31, then #1486 in v0.2.32), so Image Updater is live before the custom tag process is removed.

  4. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item kept in v0.2.31: a person placed it in v0.2.31, and that placement stands.

    • Priority: P2-Medium. Owner-requested planned improvement with a clear design and a companion issue (#1486), but the current process works after #1451, so it is not urgent.
    • Value: Medium. Removes a custom release-time tag-bump step and eliminates the window where main pins a not-yet-published image, improving maintainability and reliability of the deploy pipeline.
    • Effort: Medium. Requires installing a new Helm chart, creating an ImageUpdater CR, adjusting imagePullPolicy on two workloads, writing render and merge-patch tests, and updating documentation.
  5. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Admitted to v0.2.31: after v0.2.31 started, only a critical fix can join it. A person can place it in a planned release, and that placement stands. (devops roadmap reprioritize)

  6. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1489, merged into release/v0.2.31 as 1af11de.

    Summary

    Closes #1485

    • New Application argocd-image-updater (k8s/argocd/apps/argocd-image-updater.yaml). It installs the argo-helm chart argocd-image-updater pinned to 1.3.1 into namespace argocd, and the cluster app-of-apps manages it like the other chart Applications. AppProject homelab already allows the chart repository, the namespace and cluster-scoped kinds (the CRD).
    • k8s/argocd/image-updater-values.yaml holds the only Image Updater configuration: one ImageUpdater, devops, in the chart's extraObjects. It selects Application devops and image ghcr.io/dan-petty/devops-cli/service:latest, with updateStrategy: digest and no writeBackConfig. Image Updater therefore writes service:latest@sha256:<digest> into the Application's spec.source.kustomize.images and commits nothing. The CR syncs together with its CRD, so Argo CD skips its dry run without needing a sync option. The GHCR package is public, so no registry credentials are needed.
    • The cluster app-of-apps already ignores /spec/source/kustomize on devops, so its self-heal keeps the digest. Only the comment in cluster.yaml changes. deploy-stack's merge patch replaces only kustomize.patches.
    • Both workloads already set imagePullPolicy: IfNotPresent; the CronJob has had it since v0.2.26. A new test pins both.
    • k8s/README.md:
      • The GitOps section now counts 21 Applications (13 Helm).
      • A new "Service Image Updates" subsection names the Application and shows how to read t…

    9 file(s) changed.

    How it was verified

    Check runs at a556075:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1485-argocd-image-updater.md:

    • The new Application pins the chart version, and a test renders the ImageUpdater resource: it selects exactly Application devops and image service:latest with strategy digest, and sets no git write-back. test_image_updater_runs_the_pinned_argo_helm_chart_in_the_argocd_namespace pins the chart source (argo-helm, argocd-image-updater, 1.3.1, the values file), the destination, and that AppProject homelab admits the repository, the namespace and cluster-scoped kinds. test_image_updater_keeps_only_application_devops_on_the_digest_of_service_latest compares the whole values file, which the chart's extraObjects template renders as written, and matches namePattern against every Application in the repository: only devops matches. Both are in tests/test_k8s_argocd_apps.py.
    • Both workloads set imagePullPolicy: IfNotPresent. test_both_workloads_run_the_digest_image_updater_sets_and_pull_it_only_when_missing (tests/test_k8s_devops_runtime.py) renders Application devops's overlay with Image Updater's kustomize.images entry through kubectl kustomize: CronJob devops-cli and Deployment roadmap-service both run service:latest@sha256:<digest> with IfNotPresent, despite the newTag pin.
    • A test shows deploy-stack's host merge patch (argocd_overrides.py) leaves spec.source.kustomize.images untouched. test_deploy_stack_leaves_the_service_digest_image_updater_set_on_application_devops (tests/test_k8s.py) runs devops k8s deploy-stack --stack devops against the suite's Argo CD-managed cluster double, then applies the kubectl patch it sent, with the patch type it sent, to a live Application holding Image Updater's digest and an older host patch through kubectl patch --local, which makes no request. The result keeps the digest and holds only the new host patches.
    • k8s/README.md's GitOps section names the new Application and how to read the deployed digest (kubectl -n argocd get imageupdater devops, its status.recentUpdates, Application devops's spec.source.kustomize.images, and the controller's log).
    • Pending a person: after the release that carries this merges, Application argocd-image-updater is Synced and Healthy, Deployment argocd-image-updater-controller in argocd is ready, and kubectl -n argocd get imageupdater devops shows Ready True with one application and one image.
    • Pending a person: within one poll (2 minutes) of the controller starting, kubectl -n argocd get application devops -o jsonpath='{.spec.source.kustomize.images}' holds ghcr.io/dan-petty/devops-cli/service:latest@sha256:<digest>, where <digest> is what docker buildx imagetools inspect ghcr.io/dan-petty/devops-cli/service:latest --format '{{ .Manifest.Digest }}' prints, and the roadmap-service pod runs that reference (kubectl -n devops get pods -l app.kubernetes.io/name=roadmap-service -o jsonpath='{.items[*].spec.containers[*].image}').
    • Pending a person: when the next release moves latest, the roadmap-service Deployment rolls within one poll, ImageUpdater devops's status.recentUpdates records the update, and no commit from Image Updater reaches the repository.
    • changelog.d/1485.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/k8stype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions