Skip to content

feat(k8s): run the stage job in the runner image #6417

Description

@dan-petty

Goal

Owner decision of 2026-11-19: the Jobs that change git (stage, implement and fix-checks) run in the devtools-based runner image. k8s/devops/cronjob-stage.yaml:87 uses ghcr.io/dan-petty/devops-cli/service today. The implement and fix-checks Jobs already use the runner template (cronjob-runner.yaml:53).

Change

  • Switch the stage Job template to the runner image (devtools-based after build(docker): build the runner image FROM devtools with no tool install #4361).
  • Allow it in k8s/devops/roadmap-service/admissionpolicy.yaml and in the image updater values.
  • Then measure whether the Service Deployment still needs gh and openspec. If not, a later item removes them from the service image.
  • The change goes live through git and Argo CD, not through kubectl.

Renovate. None. The images keep their current tag and digest management (image updater and the kubernetes manager).

Risk. Medium. The runner image is larger than the service image, so the start time and memory of the stage pod change. A bad admission rule stops every stage Job, so roll it out with a single item first.

Proof

  • devops k8s run-job --template stage plans one Ready item in the runner image and pushes its branch.
  • The admission policy accepts the Job.

Depends on: #4361

Proposed design

Problem statement

The stage Job still runs the service image. The owner decided that stage, implement and fix-checks Jobs use the devtools-based runner image. This change switches the stage CronJob template and its admission rule to the runner image. It also updates the image updater values. The change reaches the cluster through Git and Argo CD.

Acceptance criteria

Requirement: Stage CronJob image

The stage CronJob template SHALL use image ghcr.io/dan-petty/devops-cli/runner.

Scenario: Stage template uses the runner image

  • WHEN uv run devops ci --check --only k8s runs
  • THEN the k8s check passes with the stage CronJob template on image ghcr.io/dan-petty/devops-cli/runner.

Requirement: Stage Job admission

The admission policy MUST accept ghcr.io/dan-petty/devops-cli/runner for a stage Job and reject the service image for that Job.

Scenario: Admission policy accepts the stage runner image

  • WHEN uv run devops ci --check --only k8s runs
  • THEN the k8s check passes with the stage admission rule on the runner image.

Requirement: Stage image updater

The image updater values MUST track ghcr.io/dan-petty/devops-cli/runner for the stage Job template.

Scenario: Image updater tracks the stage runner image

  • WHEN uv run devops ci --check --only k8s runs
  • THEN the k8s check passes with the stage image updater entry on the runner repository.

Requirement: Stage Job proof

A stage Job created from the template MUST run its pod in the runner image and push the branch of one Ready item.

Scenario: Run one stage Job from the template

  • WHEN uv run devops k8s run-job --template stage runs for one Ready item
  • THEN it plans the item in a pod with image ghcr.io/dan-petty/devops-cli/runner and pushes the branch.

Existing Tool Considered

No alternatives check has run. Kubernetes CronJob, ValidatingAdmissionPolicy and Argo CD are open, maintained tools that cover this manifest change. The change builds no new code.

Key questions

  • Which image should the stage CronJob template use?: Use ghcr.io/dan-petty/devops-cli/runner, as the owner decided on 2026-11-19. The stage template uses ghcr.io/dan-petty/devops-cli/service today. (best practice) [sources: k8s/devops/cronjob-stage.yaml:87, k8s/devops/cronjob-runner.yaml:53]
    • Rejected: Service image. The owner decision changes the stage Job to the runner image.
    • Chosen: Runner image. The owner decision names the devtools-based runner image for stage, implement and fix-checks Jobs.
  • How should the admission policy change for a stage Job?: Change the stage branch of the image rule to allow ghcr.io/dan-petty/devops-cli/runner alone or with a tag or digest, and update the refusal message. The runner branch already allows that image. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, tests/gate/k8s_checks/job_admission_policy.py]
    • Rejected: Keep the service image for stage. It contradicts the owner decision and leaves the stage Job on the service image.
    • Rejected: Allow both images for stage. It permits a stage Job to keep the service image, which the owner decision rejects.
    • Chosen: Allow the runner image for stage. It matches the owner decision and the runner template.
  • Which image repository should the image updater values track for the stage template?: Track ghcr.io/dan-petty/devops-cli/runner for the stage template, because the stage Job now uses that image. (best practice) [sources: k8s/devops/cronjob-stage.yaml:87, k8s/devops/roadmap-service/admissionpolicy.yaml]
    • Rejected: Keep the service repository. It leaves the stage template on the service image and contradicts the owner decision.
    • Chosen: Use the runner repository. It keeps the image updater on the image that the stage Job uses.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4361

Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches for per-workload image admission rules and Argo CD image updater returned only unrelated pages, no tool. The need is a repository-specific edit of the stage CronJob template, its ValidatingAdmissionPolicy rule and updater values, which no external tool covers.

Activity

  1. added
    type/feature
    scope/k8s
    source/agent
    status/new
    on Nov 19, 2026
  2. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor
  3. added
    value/medium
    effort/low
    priority/p2-medium
    on Nov 19, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  5. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (4)

    Searches run:

    • Kubernetes ValidatingAdmissionPolicy restrict container image per CronJob template, results: 5
    • Argo CD Image Updater per workload image repository annotation CronJob, results: 5
    • argocd image updater documentation, results: 5
    • kyverno policy enforce container image per workload, results: 5

    Sources:

  6. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 20, 2026
  7. removed
    status/in-review
    owner/agent
    on Nov 21, 2026
  8. added a commit that references this issue on Nov 21, 2026
  9. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-21 02:17 UTC

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

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions