Skip to content

Adding support for DNS based injection URLs in webhook probe check - #2042

Open
Dimss wants to merge 2 commits into
istio-ecosystem:mainfrom
Dimss:fix/1934-injectionurl
Open

Adding support for DNS based injection URLs in webhook probe check#2042
Dimss wants to merge 2 commits into
istio-ecosystem:mainfrom
Dimss:fix/1934-injectionurl

Conversation

@Dimss

@Dimss Dimss commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator
  • Enhancement / New Feature
  • Bug Fix
  • Refactor
  • Optimization
  • Test
  • Documentation Update

What this PR does / why we need it:

DNS-based injection URLs (for example, allocated by AWS LB) will now work correctly in the probe check.

Which issue(s) this PR fixes:

Fixes #1934

Related Issue/PR #
#1091

@Dimss
Dimss requested a review from a team as a code owner June 28, 2026 14:12
@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.41%. Comparing base (6b3380c) to head (310a654).
⚠️ Report is 68 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2042       +/-   ##
===========================================
+ Coverage   53.30%   83.41%   +30.11%     
===========================================
  Files          59       59               
  Lines        3236     2901      -335     
===========================================
+ Hits         1725     2420      +695     
+ Misses       1408      481      -927     
+ Partials      103        0      -103     
Flag Coverage Δ
integration-tests 74.49% <ø> (?)
unit-tests 62.35% <100.00%> (+9.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dgn dgn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for working on this. I don't think we should make assumptions about the URL though (ie that the /ready endpoint is available - it often isn't especially when the webhook is behind a gateway). I think a simpler way would be to just send a GET request to the actual /inject endpoint. If it returns a 4xx error, we're good. If there's a network error, we're not. It's not perfect, but it does at least give us network availability

case config.URL != nil:
return "", errors.New("only webhooks pointing to a Service are supported")
if u, err := url.Parse(*config.URL); err == nil && u.Scheme != "" && u.Host != "" {
return fmt.Sprintf("%s://%s/ready", u.Scheme, u.Host), nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

a few issues I see with this approach:

  1. we're dropping the path entirely. if the URL is mydomain.custom/istio/inject we're rewriting to mydomain.custom/ready which does not seem correct
  2. we assume blindly that /ready is actually exposed. that might not be the case though. especially when the /inject endpoint is behind a gateway

@Dimss Dimss Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, but I do not think we can get it somewhere else. In External-Remote setup (this is where we mainly need DNS based mutation webhook URL) The config.URL will be something like this https://DNS-HOST:15017/inject/cluster/cluster2/net/network1, and it will be always placed behind a Gateway. We can't use /inject/cluster/cluster2/net/network1 for the health check obviously, and we've no other place where user can define the health check path for the external mutation webhook.

In addition to that:

  1. The probing we do in webhook_controller.go does not exists in upstream
  2. The sail-operator healthy probe is useful only on the first (create) reconcile, i.e if probe is failing sail-operator won't continue reconciliation loop (no istiod or other related resources will be created). But, if the external webhook become broken after at least one successful reconcile, sail-operator will do nothing with it.

@Dimss
Dimss force-pushed the fix/1934-injectionurl branch from 84ca89e to 48520d5 Compare July 13, 2026 13:07
@dgn

dgn commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

hey @Dimss I thought some more about your feedback and I kind of agree that the probes are maybe not the right way. I experimented with a different approach, PTAL: #2139

Comment thread docs/deployment-models/multicluster.adoc
Fixes istio-ecosystem#1934

Signed-off-by: Dmitry Kartsev <dkartsev@redhat.com>
@Dimss
Dimss force-pushed the fix/1934-injectionurl branch from 48520d5 to 1074ee6 Compare July 16, 2026 09:40
@dgn

dgn commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

/retest

@dgn dgn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

tests and lint still failing...

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>
@istio-testing

Copy link
Copy Markdown
Collaborator

@Dimss: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
lint_sail-operator_main 310a654 link true /test lint
docs-test_sail-operator_main 310a654 link false /test docs-test
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@dgn dgn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

still broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Sail Operator does not support the injectionURL

3 participants