fix(base): replace ensureLease init container with pre-install hook Job#149
Merged
Conversation
The kubectl init container in the log-controller DaemonSet was pulling bitnami/kubectl from Docker Hub once per node per deploy, causing rate limit errors on clusters with many nodes. - Replace init container with a pre-install,pre-upgrade hook Job so kubectl is pulled only once per Helm operation regardless of node count - Convert lease.yaml to a pre-install hook to prevent Helm SSA from fighting the logs controller over holderIdentity on every upgrade - Add dedicated RBAC (SA, ClusterRole, ClusterRoleBinding) as hook resources with weight -5 so they exist before the Job runs - Remove holderIdentity from the lease spec so the controller has full SSA ownership of that field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gdrojas
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
ensure-leaseinit container in thenullplatform-log-controllerDaemonSet pullsbitnami/kubectlfrom Docker Hub on every pod startup. Since a DaemonSet runs one pod per node, a cluster with N nodes triggers N image pulls per deploy — causing Docker Hub rate limit errors reported by customers.Additionally,
lease.yamlwas a regular Helm template, causing Helm's SSA to conflict with thek8s-logs-controlleroverholderIdentityon every upgrade (revisions 3, 5 in minikube history showed this exact failure).Changes
daemonset.yaml: Removeensure-leaseinit container entirely — eliminates all Docker Hub pulls from the DaemonSetpre-install-lease.yaml(new): Hook Job (pre-install,pre-upgrade) that creates the Lease once per Helm operation, regardless of node count. Controlled by existinglogging.ensureLeaseflaglease.yaml: Convert from regular template topre-installhook — Helm creates it on install only, never SSA-applies it on upgrade. RemovesholderIdentityfrom spec so the controller has full SSA ownershipserviceaccount.yaml/clusterroles.yaml/clusterrolebindings.yaml: Add hook RBAC (hook-weight: -5) for the new Job SAArgoCD compatibility
holderIdentityTest plan
helm template --set logging.ensureLease=truerenders Job hook + RBAC, noinitContainersin DaemonSethelm upgrade --set logging.ensureLease=trueon minikube — Job completes, Lease created (lease.coordination.k8s.io/nullplatform-metrics-extractor configured)helm template(defaultensureLease=false) renders zero lease-installer resources🤖 Generated with Claude Code