[NET-5586][rebased] v2: Support virtual port references in config #20371
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Rebased @zalimeni's PR #20327 on top of the computed failover policy changes and pushed here just to not lose the changes on the original PR in case something is wrong with this one.
I needed to change the failover controller and failover controller test to make it work with the new computed failover policy changes that got merged into main.
Original PR contents:
Currently, when referencing a service in a parent/backend ref in an xRoute (example), destination ref in a
Destinations
resource, or port in an xPolicy config key, we only allow operators to specify workload port name (i.e the Service'sspec.ports[0].targetPort
in K8s terms). This is not an intuitive UX for K8s users, who will be thinking of the service ports (i.e. Servicespec.ports[0].port
in K8s) rather than workload ports when creating these objects.This change updates our interpretation of these reference fields/keys (parent, backend, destination), s.t.:
ServicePort.virtual_port
ServicePort.target_port
(this supports VMs/Nomad and other cases where network virtual ports are not used, and port names are expected to be in reference to workload ports, not service ports)The effect should be a superset of existing functionality, with the additional option of specifying a virtual port (numeric string) where a service target port was previously required. Note that this does not apply to workload port definitions and endpoints config (which references workload port names), as virtual ports are only a facility of the service abstraction.
Testing & Reproduction steps
Links
PR Checklist