Fix duplicate ACME challenge paths across ingress rules#16259
Fix duplicate ACME challenge paths across ingress rules#16259knative-prow[bot] merged 2 commits intoknative:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16259 +/- ##
==========================================
+ Coverage 80.05% 80.11% +0.05%
==========================================
Files 215 215
Lines 13327 13331 +4
==========================================
+ Hits 10669 10680 +11
+ Misses 2299 2293 -6
+ Partials 359 358 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
82c3477 to
5706862
Compare
When a Service has traffic tags, the Route controller was adding ALL ACME challenge paths to EVERY external ingress rule. This caused each challenge path to appear multiple times, leading to routing conflicts. For example, with tags "blue" and "green", the challenge for blue-app.example.com would incorrectly appear in both the blue and green ingress rules. Solution: Create a dedicated ingress rule for each ACME challenge domain. Each rule contains only that challenge's path, preventing duplicates while allowing the same domain to appear in both traffic and ACME rules.
5706862 to
d6a585e
Compare
|
/retest |
|
/test all |
|
/test https |
|
Changes look good. /lgtm /hold Running https tests |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, linkvt The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test istio-latest-mesh-tls |
|
/retest |
|
Ok we have HTTP01 tests but it's not running now Looks like it runs on the periodic test? I'm guessing because running it for every PR is too much Let's merge this and @linkvt can you track those periodic tests for failures /hold cancel |
|
Interesting, the tests I fixed with related PRs in the net-kourier repo a few days ago are failing again: https://testgrid.k8s.io/r/knative-own-testgrid/serving#kourier-stable I will wait for another failure before looking into it. Edit: Never mind, was able to identify the issue in net-kourier. envoy uses the first matching path, if |
|
There is now another additional test failure 🥲 Seems like contour also has a problem: https://testgrid.k8s.io/r/knative-own-testgrid/serving#contour-latest Edit: kourier wasn't updated yet so my fix wasn't used in the test, need to check kourier again after: #16299 |
Fixes #16258
When a Service has traffic tags, the Route controller was adding ALL ACME challenge paths to EVERY external ingress rule. This caused each challenge path to appear multiple times, leading to routing conflicts.
For example, with tags "blue" and "green", the challenge for blue-app.example.com would incorrectly appear in both the blue and green ingress rules. This happened because when iterating over traffic rules, each ACME challenge was added to EVERY rule, not just the matching one.
This also seems to trigger a bug in kourier causing our kourier-stable tests to fail since quite a while.
Edit: The bug has been fixed in the meanwhile, testgrid is now green for kourier-stable.
Solution
Create a dedicated ingress rule for each ACME challenge domain. Each rule contains only that challenge's path, preventing duplicates.
This approach was chosen because:
The same domain can now appear in both a traffic rule (for application requests) and an ACME rule (for certificate challenges).
Drawback: The list of rules is not as pretty anymore as when the default route of a public endpoint was grouped with its ACME challenge, but this is AFAIK only cosmetic.
Changes
makeACMEChallengeRules()to create one dedicated rule per ACME challengeMakeACMEIngressPaths()remains unchanged for backward compatibility with DomainMappingBefore/After Example
Before: Three external traffic rules, each containing ALL three ACME challenge paths (9 total path entries for 3 challenges):
After: Three external traffic rules without ACME paths, plus three dedicated ACME rules (3 total path entries for 3 challenges):
Release Note