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

ambient: add traffic routing docs #12781

Merged
merged 4 commits into from
Feb 27, 2023

Conversation

howardjohn
Copy link
Member

This fills in part of the architecture doc for ambient.

Note this is intentionally low-level. This attempts to mirror https://istio.io/latest/docs/ops/configuration/traffic-management/traffic-routing/ but for ambient.

Please provide a description for what this PR is for.

And to help us figure out who should review this PR, please
put an X in all the areas that this PR affects.

  • Configuration Infrastructure
  • Docs
  • Installation
  • Networking
  • Performance and Scalability
  • Policies and Telemetry
  • Security
  • Test and Release
  • User Experience
  • Developer Infrastructure

This fills in part of the architecture doc for ambient.

Note this is intentionally low-level. This attempts to mirror
https://istio.io/latest/docs/ops/configuration/traffic-management/traffic-routing/
but for ambient.
@howardjohn howardjohn requested a review from a team as a code owner February 24, 2023 18:29
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 24, 2023
@@ -13,4 +13,77 @@ This page is under construction.

## Traffic routing

In ambient mode, workloads can fall into 3 categories:
* Uncaptured: this is a standard pod without any mesh features enabled
* Captured: this is a pod that has traffic intercepted by `ztunnel`. Pods can be captured by setting the `istio.io/dataplane-mode=ambient` label on a namespace.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume there will be some intro material that describes the architectural components, but I wonder if it might be worth adding some glossary entries and reference them in the first use in this doc, to make it more easy to read alone?

Suggested change
* Captured: this is a pod that has traffic intercepted by `ztunnel`. Pods can be captured by setting the `istio.io/dataplane-mode=ambient` label on a namespace.
* Captured: this is a pod that has traffic intercepted by {{< gloss >}}ztunnel{{< /gloss >}}. Pods can be captured by setting the `istio.io/dataplane-mode=ambient` label on a namespace.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this is intended to be the deep dive. Writing the docs in reverse order, but users will see this last. Agree on glossary

Copy link
Member Author

Choose a reason for hiding this comment

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

Ill make another PR with glossary

In ambient mode, workloads can fall into 3 categories:
* Uncaptured: this is a standard pod without any mesh features enabled
* Captured: this is a pod that has traffic intercepted by `ztunnel`. Pods can be captured by setting the `istio.io/dataplane-mode=ambient` label on a namespace.
* Waypoint enabled: this is a pod that is "Captured" *and* has a waypoint proxy deployed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Waypoint enabled: this is a pod that is "Captured" *and* has a waypoint proxy deployed.
* Waypoint enabled: this is a pod that is "Captured" *and* has a {{< gloss >}}waypoint proxy{{< /gloss >}} deployed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Noting the next line just uses waypoint, would it be better to have the single word in the glossary?

Requests to a `Service` will be sent to an endpoint within the `Service`, and requests directly to a `Pod` IP would be go directly to that `Pod` IP.

However, depending on the destination's capabilities, different behavior will occur.
If the destination is also captured, or otherwise has Istio proxy capabilities (such as a sidecar), the request will be upgraded to an encrypted HBONE tunnel.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
If the destination is also captured, or otherwise has Istio proxy capabilities (such as a sidecar), the request will be upgraded to an encrypted HBONE tunnel.
If the destination is also captured, or otherwise has Istio proxy capabilities (such as a sidecar), the request will be upgraded to an encrypted {{< gloss >}}HBONE{{< /gloss >}} tunnel.


When the destination is waypoint enabled, all requests *must* go through the waypoint, where policy is enforced.
The `ztunnel` will enforce this occurs.
However, there is an edge case: a well behaving HBONE client (such as another ztunnel or Istio sidecar) would know to send to the waypoint, but for other clients
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
However, there is an edge case: a well behaving HBONE client (such as another ztunnel or Istio sidecar) would know to send to the waypoint, but for other clients
However, there is an edge case: a well behaving HBONE client (such as another `ztunnel` or Istio sidecar) would know to send to the waypoint, but other clients

The `ztunnel` will enforce this occurs.
However, there is an edge case: a well behaving HBONE client (such as another ztunnel or Istio sidecar) would know to send to the waypoint, but for other clients
(such as a workload outside of the mesh) likely would not know anything about waypoint proxies and send requests directly.
When these direct calls are made, the ztunnel will "hairpin" the request to its own waypoint to ensure policies are properly enforced.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What exactly does "hairpin" mean? "Capture and redirect"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically

client -> ztunnel -> waypoint -> ztunnel

@@ -13,4 +13,77 @@ This page is under construction.

## Traffic routing

In ambient mode, workloads can fall into 3 categories:
* Uncaptured: this is a standard pod without any mesh features enabled.
* Captured: this is a pod that has traffic intercepted by `ztunnel`. Pods can be captured by setting the `istio.io/dataplane-mode=ambient` label on a namespace.
Copy link
Member

Choose a reason for hiding this comment

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

Should we also mention the redirection annotation on the pod here @howardjohn ?

If the destination is also captured, or otherwise has Istio proxy capabilities (such as a sidecar), the request will be upgraded to an encrypted HBONE tunnel.
If the destination has a waypoint proxy, in addition to being upgraded to HBONE, the request will instead be forwarded to that waypoint.

Note that in the case of a request to a `Service`, a specific endpoint will be selected to determine if it has a waypoint.
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to explain how the specific endpoint would be selected? Is it randomly?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is an implementation detail - currently its random but we will optimize it in the future. I don't mind putting it but it will change

Copy link
Member

Choose a reason for hiding this comment

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

I see, ok, SGTM not documenting it for now.

For direct requests to `Pod`s, these are simply forwarded directly after policy is applied.

For requests to `Service`s, the waypoint will also apply routing and load balancing.
By default, a `Service` will simply route to itself, load balancing across its endpoints.
Copy link
Member

Choose a reason for hiding this comment

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

Does waypoint only route to waypoint enabled endpoints?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, makes sense.

Copy link
Member

@linsun linsun left a comment

Choose a reason for hiding this comment

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

Contents LGTM, left a few questions hoping to get some clarification!

@istio-testing istio-testing merged commit 334e014 into istio:master Feb 27, 2023
justedennnnn pushed a commit to justedennnnn/istio.io that referenced this pull request Jun 29, 2023
* ambient: add traffic routing docs

This fills in part of the architecture doc for ambient.

Note this is intentionally low-level. This attempts to mirror
https://istio.io/latest/docs/ops/configuration/traffic-management/traffic-routing/
but for ambient.

* Address Frank's comments

* Update content/en/docs/ops/ambient/architecture/index.md

Co-authored-by: Lin Sun <[email protected]>

* Update content/en/docs/ops/ambient/architecture/index.md

Co-authored-by: Frank Budinsky <[email protected]>

---------

Co-authored-by: Lin Sun <[email protected]>
Co-authored-by: Frank Budinsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants