Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a pod-level opt-out for ambient DNS proxying, in preparation for enabling that by default globally #3361

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bleggett
Copy link
Contributor

@bleggett bleggett commented Nov 14, 2024

Relates to istio/istio#49829

This is the API side, putting it up for comment/TOC approval with a hold, impl pending.

@bleggett bleggett requested a review from a team as a code owner November 14, 2024 18:21
@istio-policy-bot
Copy link

😊 Welcome @bleggett! This is either your first contribution to the Istio api repo, or it's been
a while since you've been here.

You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@istio-testing istio-testing added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 14, 2024
@bleggett bleggett added the do-not-merge/hold Block automatic merging of a PR. label Nov 14, 2024
@@ -573,3 +573,13 @@ annotations:
hidden: true
resources:
- Pod

- name: ambient.istio.io/bypass-dns-capture
Copy link
Member

Choose a reason for hiding this comment

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

what is the specific case requiring this?

If there is, shouldn't this be per node rather than per pod

Copy link
Contributor Author

@bleggett bleggett Nov 18, 2024

Choose a reason for hiding this comment

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

@hzxuzhonghu we haven't encountered an in the wild use case for this yet.

We want to turn on DNS proxying by default globally for ambient. There are some concerns that since ambient DNS capture (like sidecar DNS capture) does change DNS resolution behavior, this may break obscure/fragile apps.

That's the only concern we have with enabling it by default really, and since we can't really fix that potential incompatibility, proposing this as an escape valve in case those particular apps exist and need an opt-out.

It is true that no one has reported issues yet, but that is likely because DNS capture is not enabled by default. It would be good to have this in place before we do that, as an Alpha label.

If no one uses it, we can drop it. If they do, we can promote it.

If people would rather wait until we turn ambient DNS capture on by default and get a concrete report of a user with a flaky app requiring the opt-out, I am fine with that, as well.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! This is helpful to understand the motivation for adding this annotation.

Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

LGTM overall, one small comment

annotation/annotations.yaml Outdated Show resolved Hide resolved
@costinm
Copy link
Contributor

costinm commented Nov 19, 2024 via email

@bleggett
Copy link
Contributor Author

bleggett commented Nov 19, 2024

I think the model used by Istio - you need to modify your app deployment so it is not broken - does not work well for ambient. Many users install apps with 'helm install' and not all of them have ways to add annotations (and users may not have an easy time finding them). So I am pretty much against using annotations or labels on the Pod - using a separate resource would work much better. We did this for a couple of things in mesh config and in Sidecar CR.

On Mon, Nov 18, 2024 at 9:05 AM Ben Leggett @.> wrote: @.* commented on this pull request. ------------------------------ In annotation/annotations.yaml <#3361 (comment)>: > @@ -573,3 +573,13 @@ annotations: hidden: true resources: - Pod + + - name: ambient.istio.io/bypass-dns-capture It's a good point, I had originally intended to keep this explicitly simple/obvious as opt-out only. But in-or-out is also doable. If we want that (or think we might in the future) I am OK with something generic like ambient.istio.io/dns-capture that maybe only supports a single value of false to start with. — Reply to this email directly, view it on GitHub <#3361 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAUR2UEYDCFHKFRSE6GT5L2BIM43AVCNFSM6AAAAABRZQQLPWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDINBTGIZDCNZSG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Some overlap with the convo here, and we can talk on Wed: istio/istio#53886 (comment)

Many users install apps with 'helm install' and not all of them have ways to add annotations (and users may not have an easy time finding them).

So I am pretty much against using annotations or labels on the Pod - using a separate resource would work much better. We did this for a couple of things in mesh config and in Sidecar CR.

I agree using pod-level config has downsides, but the inverse of that is that users deploying workloads/pods may not have access to mutate a separate Istio resource either, and may not have an easy time of finding where/how to do that either, and requiring one-off opt-outs like this to be centralized doesn't simplify things for users, it just means in most cases they won't be able to easily opt-out.

It's the old app owner != cluster owner != istio owner problem.

This is, for example, why ambient dataplane exclusion at the pod level currently overrides the namespace level.

@costinm
Copy link
Contributor

costinm commented Nov 20, 2024 via email

@bleggett
Copy link
Contributor Author

bleggett commented Nov 20, 2024

Okie dokie - In the ambient WG today I think what we settled on for the autoEnroll feature also makes a lot of sense here:

  • Rather than use labels for this, have a ~reasonably centralized config with user defined match selectors.

I think that will satisfy most of the concerns raised here, and needing to do that for autoEnroll makes it pretty reasonable to do for this as well. I'll close this, and have a go at doing it like that.

@bleggett bleggett closed this Nov 20, 2024
@bleggett bleggett reopened this Dec 9, 2024
@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Dec 9, 2024
…enabling that by default globally.

Signed-off-by: Benjamin Leggett <[email protected]>
Signed-off-by: Benjamin Leggett <[email protected]>
@bleggett bleggett force-pushed the bleggett/dns-ambient-exclude branch from ac41511 to a81bded Compare December 9, 2024 20:58
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Dec 9, 2024
@bleggett
Copy link
Contributor Author

bleggett commented Dec 9, 2024

I originally closed this because at the time I was intending to do autoEnroll istio/istio#53886

which would use a selector-based API. That selector based API would allow operators to write selectors that disallowed pod-level opt-outs (not currently possible in ambient, since all traffic capture APIs allow pod-level opt-outs)

But I think we're tabling autoEnroll and the selector-style API for ambient enrollment that goes with it, so reopening this to just do pod-level DNS opt-outs, like the current ambient enrollment mechanism supports for general traffic.

A uniform control API that supports top-down policy enforcement with no pod-level opt-outs is (I believe) a good idea, but if we don't have that for ambient traffic capture generally at this time, there's no reason to have it for DNS traffic capture uniquely at this time either.

- 49829
releaseNotes:
- |
**Added** `ambient.istio.io/bypass-dns-capture` annotation. When specified on a `Pod` enrolled in ambient mesh, DNS traffic (TCP and UDP on port 53) will not be captured or proxied. This will break some Istio features, such as ServiceEntries and egress waypoints, but may be desirable for workloads that interact poorly with DNS proxies.
Copy link
Member

Choose a reason for hiding this comment

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

note is stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Block automatic merging of a PR. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants