Skip to content

longhorn stale-node-cleanup CronJob has never run: distroless kubectl image has no /bin/shΒ #2384

Closed

Description

@devantler

πŸ€– Generated by the Daily AI Assistant

Problem

k8s/providers/hetzner/infrastructure/controllers/longhorn/cron-job-stale-node-cleanup.yaml (shipped in #2341 for #2024) runs /bin/sh -c <script> in registry.k8s.io/kubectl:v1.36.2 β€” a distroless image with no shell β€” so every scheduled run fails with StartError exit 128. The self-healing cleanup of orphaned Longhorn Node CRs has never actually executed; orphaned CRs from autoscaler scale-downs still accumulate. Observed live 2026-07-02 (interactive prod analysis; re-verify before acting).

Proposed direction

Keep the script but give it a runtime that has both a shell and kubectl. Options, preferred first:

  1. bitnami/kubectl (shell + kubectl, widely used) pinned by digest;
  2. keep registry.k8s.io/kubectl but replace the shell script with a kubectl-only invocation (no sh) if the logic can be expressed as a single kubectl call with jsonpath/go-template β€” it currently loops, so likely not;
  3. an initContainer copying kubectl into a busybox runtime (avoid β€” complexity).

Whichever image is chosen must pass the verify-app-images/registry policies and be Renovate-trackable.

Rough size

S β€” one image swap + a validated manifest; confirm the next scheduled run completes and deletes a known orphaned Node CR.

Activity

  1. devantler commented on Jul 2, 2026

    @devantler
    ContributorAuthor

    πŸ€– Generated by the Daily AI Assistant

    Superseded: the fix is already in flight as draft #2380 (shipped by the parallel session before this issue was filed β€” parallel-run overlap). Tracking continues there.

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

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions