Skip to content

policy attachment: allow targetRefs#3159

Merged
istio-testing merged 4 commits intoistio:masterfrom
howardjohn:target-ref/allow-target-refs
Apr 12, 2024
Merged

policy attachment: allow targetRefs#3159
istio-testing merged 4 commits intoistio:masterfrom
howardjohn:target-ref/allow-target-refs

Conversation

@howardjohn
Copy link
Copy Markdown
Member

Based on kubernetes-sigs/gateway-api#2966. Note
that we do not HAVE to follow the GatewayAPI here; we can make our own
decision. There is, however, a general desire to allow multiple for
ergonomics.

In this proposal, I hide targetRef, but the API will remain + be
implemented forever. Implementation cost here is near zero, as we can
easily translate it to a single targetRefs; we just hide from docs to
push users toward the new ones.

Based on kubernetes-sigs/gateway-api#2966. Note
that we do not HAVE to follow the GatewayAPI here; we can make our own
decision. There is, however, a general desire to allow multiple for
ergonomics.

In this proposal, I hide `targetRef`, but the API will remain + be
implemented forever. Implementation cost here is near zero, as we can
easily translate it to a single `targetRefs`; we just hide from docs to
push users toward the new ones.
@howardjohn howardjohn requested a review from a team as a code owner April 12, 2024 14:06
@howardjohn howardjohn added the release-notes-none Indicates a PR that does not require release notes. label Apr 12, 2024
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 12, 2024
@howardjohn
Copy link
Copy Markdown
Member Author

cc @mikemorris @keithmattix

Copy link
Copy Markdown
Member

@mikemorris mikemorris left a comment

Choose a reason for hiding this comment

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

LGTM, is there any need to update the note below which is present on most of these fields to account for a singular targetRet in Istio 1.21?

  // NOTE: If you are using the `targetRefs` field in a multi-revision environment with Istio versions prior to 1.20,
  // it is highly recommended that you pin the authorization policy to a revision running 1.20+ via the istio.io/rev label.
  // This is to prevent proxies connected to older istiod control planes (that don't know about the targetRef field)
  // from misinterpreting the policy as namespace-wide during the upgrade process.

@howardjohn
Copy link
Copy Markdown
Member Author

LGTM, is there any need to update the note below which is present on most of these fields to account for a singular targetRet in Istio 1.21?

  // NOTE: If you are using the `targetRefs` field in a multi-revision environment with Istio versions prior to 1.20,
  // it is highly recommended that you pin the authorization policy to a revision running 1.20+ via the istio.io/rev label.
  // This is to prevent proxies connected to older istiod control planes (that don't know about the targetRef field)
  // from misinterpreting the policy as namespace-wide during the upgrade process.

Yeah I think so (plus I think I botched some of the docs in the process of copy pasting so I'll clean up generally)

howardjohn added a commit to howardjohn/api that referenced this pull request Apr 12, 2024
This is the only API we have a `selector` without `targetRef`.

The motivation at the time was that waypoints don't official support
EnvoyFilter, and targetRef was primarily for waypoints.

However, targetRef can be used with all Kubernetes Gateway, including
for ingress, where EnvoyFilter is supported. Also, long term it will
support waypoint as well I assume; the earlier we add the field the less
migration pain there is.

This PR goes directly to `targetRefs` in line with
istio#3159.
istio-testing pushed a commit that referenced this pull request Apr 12, 2024
This is the only API we have a `selector` without `targetRef`.

The motivation at the time was that waypoints don't official support
EnvoyFilter, and targetRef was primarily for waypoints.

However, targetRef can be used with all Kubernetes Gateway, including
for ingress, where EnvoyFilter is supported. Also, long term it will
support waypoint as well I assume; the earlier we add the field the less
migration pain there is.

This PR goes directly to `targetRefs` in line with
#3159.
Copy link
Copy Markdown

@ericvn ericvn left a comment

Choose a reason for hiding this comment

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

Nit on consistency with highlighting fields and including the.

//
// If not set, the policy is applied as defined by the selector.
// At most one of the selector and targetRef can be set.
// At most one of the selector and targetRefs can be set.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
// At most one of the selector and targetRefs can be set.
// At most one of the `selector` and `targetRefs` can be set.

@istio-testing istio-testing merged commit fe48267 into istio:master Apr 12, 2024
@stevenctl
Copy link
Copy Markdown
Contributor

stevenctl commented Apr 15, 2024

Did we miss WasmPlugin here?

@stevenctl
Copy link
Copy Markdown
Contributor

stevenctl commented Apr 15, 2024

and Telemetry

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

Labels

release-notes-none Indicates a PR that does not require release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants