fix: make Project Contour ingress integration opt-in (crash loop without HTTPProxy CRD)#272
Open
amuraru wants to merge 1 commit into
Open
fix: make Project Contour ingress integration opt-in (crash loop without HTTPProxy CRD)#272amuraru wants to merge 1 commit into
amuraru wants to merge 1 commit into
Conversation
The KafkaCluster controller unconditionally registered a watch on Project
Contour's HTTPProxy CRD (Owns(&contour.HTTPProxy{}), added in #82). On any
cluster without Project Contour installed, controller-runtime could never sync
the HTTPProxy informer, so the manager failed to start ("failed to wait for
KafkaCluster caches to sync kind source: *v1.HTTPProxy") and the operator pod
entered CrashLoopBackOff -- even when Contour ingress was never used.
Gate the Contour watch behind a new --contour-enabled flag (default false),
mirroring the existing --cert-manager-enabled pattern, and wire it through the
Helm chart (contour.enabled, default false). Default installs now start cleanly
without Project Contour's CRD; users of `ingressController: contour` opt in via
contour.enabled=true (which requires the HTTPProxy CRD to be installed).
Add an envtest regression test that boots a manager without the Contour CRD and
asserts it stays healthy when Contour is disabled. The e2e suite, which installs
Contour as a dependency, sets contour.enabled=true to keep exercising the
integration.
Fixes #229
Introduced by #82
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
cc @dobrerazvan — this gates the Project Contour |
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
Installing the operator on a cluster without Project Contour puts the pod in
CrashLoopBackOff— even when Contour ingress is never used. This is the crash loop reported in #229.Root cause: the
KafkaClustercontroller unconditionally registers a watch on Project Contour'sHTTPProxyCRD:When the
projectcontour.io/v1 HTTPProxyCRD is absent, controller-runtime can never sync that informer, somgr.Startfails with:…and the process exits → crash loop. The Helm chart never shipped or required the Contour CRD, so a clean install is broken out of the box (the reporter's workaround was to manually
kubectl applythe Contour CRDs).This unconditional watch was introduced in #82 ("Adding Contour Ingress support").
Fix (Option A: opt-in flag, mirroring cert-manager)
--contour-enabledflag (defaultfalse), matching the existing--cert-manager-enabledpattern. The ContourHTTPProxywatch is only registered when it's set.contour.enabled(defaultfalse) →--contour-enabled={{ .Values.contour.enabled }}.ingressController: contouropt in viacontour.enabled=true(which requires the HTTPProxy CRD to be installed).Tests
controllers/tests/contourwatch: boots an envtest API server without the Contour CRD and asserts the manager stays healthy when Contour is disabled. Verified it fails before the fix (reproduces the exact*v1.HTTPProxysync timeout) and passes after (TDD red→green).Label("contour")) still pass withcontour.enabled=true.contour.enabled=trueto keep exercising the integration end-to-end.Upgrade note
Deployments that rely on Contour ingress must set
contour.enabled=trueafter this change (previously always-on). Default/envoy users are unaffected and no longer need the Contour CRD.Notes
--versionrequirement) is being handled separately.Fixes #229
Introduced by #82
🤖 Generated with Claude Code