feat: add preflight admission readiness check before kubeadm upgrade (#13140)

* feat: add preflight admission readiness check before kubeadm upgrade

  - linked to issue #13139
  - Add opt-in dry-run Job probe to verify the admission pipeline is ready before running kubeadm upgrade apply (workaround for Kubernetes #124237)
  - Gate the check behind kubeadm_upgrade_preflight_check_enabled (default false) with configurable retries and delay
  - Emit a warning instead of failing if the preflight check does not pass

* fix: refine preflight admission check Job and warning

- Use generateName for the dry-run preflight Job to avoid fixed-name collisions
- Expand the Kubernetes issue reference in the warning to a full GitHub URL

Created with AI-assistance
This commit is contained in:
felipe88alves
2026-09-10 08:14:36 +00:00
committed by GitHub
parent b7d99749b8
commit f6b046bcac
2 changed files with 36 additions and 0 deletions
@@ -37,6 +37,14 @@ kube_controller_manager_bind_address: "::"
## Control plane health check settings
control_plane_health_retries: 60 # Default retries for apiserver, scheduler, controller-manager health checks
# Preflight admission readiness check before kubeadm upgrade (opt-in)
# Dry-runs a batch/v1 Job to verify the admission pipeline is ready after API server restart
# Workaround for Kubernetes #124237: admission controllers may be stale after API server restart
# Enable if your cluster uses admission controllers (e.g. ValidatingAdmissionPolicy) with CRD paramKind references
kubeadm_upgrade_preflight_check_enabled: false
kubeadm_upgrade_preflight_check_retries: 6
kubeadm_upgrade_preflight_check_delay: 5
# Leader election lease durations and timeouts for controller-manager
kube_controller_manager_leader_elect_lease_duration: 15s
kube_controller_manager_leader_elect_renew_deadline: 10s