Skip to content

fix(webhook): publish not-ready address so conversion bootstraps - #143

Merged
konih merged 1 commit into
mainfrom
worktree-e2e-helm-diag
Jul 24, 2026
Merged

konih merged 1 commit into
mainfrom
worktree-e2e-helm-diag

Conversation

@konih

@konih konih commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Root cause (confirmed via diagnostics on main run 30096991327)

The E2E red on main is a conversion-webhook startup deadlock, introduced by the v1beta1 storage flip (beb43f7).

The manager serves its own CRD conversion webhook. Controllers still watch the v1alpha1 spoke (For(&messagingv1alpha1...)), so with storage now v1beta1, the informer LIST at startup must convert stored objects through the webhook Service. But the Service excluded the pod until it passed readiness, and /readyz waits on cache sync, which waits on that conversion → deadlock.

Diagnostic dump from the failing Helm-on-same-cluster step:

list-v1alpha1-queuemanagerconnections error: conversion webhook ... failed:
  Post "https://mkurator-webhook-service.../convert": dial tcp 10.96.151.123:443: connect: connection refused
manager log: "Could not wait for Cache to sync ... *v1alpha1.Queue: timed out"
pod: mkurator-controller-manager  0/1  Running  (webhook server serving on :9443 the whole time)

connection refused is TCP-level — the Service had no endpoint because the pod was not-Ready. A fresh kustomize install passes because there are no stored objects to convert at startup; the deadlock only bites a cold start with stored objects (the realistic upgrade/DR path this e2e exercises).

Fix

publishNotReadyAddresses: true on both webhook Services (Helm chart + kustomize config/webhook). This lets bootstrap conversion reach the already-serving pod during startup, breaking the deadlock. Standard remedy for self-hosted conversion-webhook bootstrap; matches the staged migration (controllers stay on the spoke, conversion carries the load) — no need to migrate controllers to v1beta1.

Verification

The Helm-on-same-cluster step runs only on the main push (PR e2e runs kustomize only, and workflow_dispatch's e2e-helm job uses a fresh cluster), so this PR's own e2e cannot exercise the path. The failure-time diagnostic added in the prior commit stays in to confirm on the post-merge main run.

The manager serves its own CRD conversion webhook. With v1beta1 storage and
controllers watching the v1alpha1 spoke, the informer LIST at startup must
convert stored objects through the webhook Service — but the Service excluded
the pod until it passed readiness, and readiness waits on cache sync, which
waits on that conversion. Cold starts with stored objects (e.g. the Helm
same-cluster e2e) deadlocked: 'connection refused' to the webhook, caches never
synced, pod never Ready. publishNotReadyAddresses lets bootstrap conversion
reach the already-serving pod.
Copilot AI review requested due to automatic review settings July 24, 2026 13:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a startup deadlock where the manager’s self-hosted CRD conversion webhook Service had no endpoints during bootstrap because the pod wasn’t Ready yet, preventing informer cache sync when stored objects require conversion.

Changes:

  • Enable publishNotReadyAddresses: true on the kustomize webhook Service to publish endpoints before readiness gates pass.
  • Enable publishNotReadyAddresses: true on the Helm chart’s webhook Service template for the same bootstrap behavior.
  • Add inline comments documenting the deadlock scenario and why this setting is required.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
config/webhook/service.yaml Publishes not-ready pod addresses for the webhook Service to avoid conversion bootstrap deadlock.
charts/mkurator/templates/webhook-service.yaml Applies the same Service behavior in the Helm deployment path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@konih
konih merged commit 13b3fcb into main Jul 24, 2026
25 checks passed
@konih
konih deleted the worktree-e2e-helm-diag branch July 24, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants