This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 277
traffic-split: update root service selector & targetPort usage #4902
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shashankram
force-pushed
the
fix-4894
branch
2 times, most recently
from
July 14, 2022 23:33
799967d
to
3353f54
Compare
This change does the following: 1. Fixes the incorrect legacy behavior where traffic directed to a root service specified in a TrafficSplit resource can direct traffic to pods that do not match the root service's selector. Not only was this behavior confusing, it also significantly complicated code paths that required special handling of this scenario that is unintuitive. Going forward, the root service selector must match pods for traffic splitting to those pods to function. Existing e2e tests relying on this unsupported behavior have been updated to correctly configure selectors and labels on services and pods backing them. A redundant test explicitly testing the only supported scenario after this change has been removed. The automated demo has also been updated to correctly configure the selector and labels. 2. Fixes openservicemesh#4894, where the TargetPort on the root service was expected to match the ContainerPort on the pod backing the service. Per SMI's TrafficSplit API, the TargetPort on the root does not need to match the ContainerPort on the pod, thus allowing newer application versions to change the ports they listen on without needing to update the root service definition. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #4902 +/- ##
==========================================
- Coverage 68.73% 68.64% -0.09%
==========================================
Files 220 220
Lines 15934 15938 +4
==========================================
- Hits 10952 10941 -11
- Misses 4930 4945 +15
Partials 52 52
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Shashank Ram <shashr2204@gmail.com>
shashankram
requested review from
snehachhabria,
nojnhuh,
draychev,
jaellio,
trstringer,
keithmattix and
steeling
as code owners
July 15, 2022 18:00
shashankram
added a commit
to shashankram/osm-docs
that referenced
this pull request
Jul 15, 2022
This change updates the documentation to reflect the change made to the traffic split behavior in openservicemesh/osm#4902. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
shashankram
added a commit
to shashankram/osm-docs
that referenced
this pull request
Jul 15, 2022
This change updates the documentation to reflect the change made to the traffic split behavior in openservicemesh/osm#4902. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
shashankram
added a commit
to shashankram/osm-docs
that referenced
this pull request
Jul 15, 2022
This change updates the documentation to reflect the change made to the traffic split behavior in openservicemesh/osm#4902. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
keithmattix
approved these changes
Jul 15, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, love to see code removed
jaellio
approved these changes
Jul 15, 2022
shashankram
added a commit
to shashankram/osm
that referenced
this pull request
Jul 15, 2022
…ervicemesh#4902) This change does the following: 1. Fixes the incorrect legacy behavior where traffic directed to a root service specified in a TrafficSplit resource can direct traffic to pods that do not match the root service's selector. Not only was this behavior confusing, it also significantly complicated code paths that required special handling of this scenario that is unintuitive. Going forward, the root service selector must match pods for traffic splitting to those pods to function. Existing e2e tests relying on this unsupported behavior have been updated to correctly configure selectors and labels on services and pods backing them. A redundant test explicitly testing the only supported scenario after this change has been removed. The automated demo has also been updated to correctly configure the selector and labels. 2. Fixes openservicemesh#4894, where the TargetPort on the root service was expected to match the ContainerPort on the pod backing the service. Per SMI's TrafficSplit API, the TargetPort on the root does not need to match the ContainerPort on the pod, thus allowing newer application versions to change the ports they listen on without needing to update the root service definition. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
trstringer
pushed a commit
that referenced
this pull request
Jul 18, 2022
…sage (#4902) (#4905) * traffic-split: update root service selector & targetPort usage (#4902) This change does the following: 1. Fixes the incorrect legacy behavior where traffic directed to a root service specified in a TrafficSplit resource can direct traffic to pods that do not match the root service's selector. Not only was this behavior confusing, it also significantly complicated code paths that required special handling of this scenario that is unintuitive. Going forward, the root service selector must match pods for traffic splitting to those pods to function. Existing e2e tests relying on this unsupported behavior have been updated to correctly configure selectors and labels on services and pods backing them. A redundant test explicitly testing the only supported scenario after this change has been removed. The automated demo has also been updated to correctly configure the selector and labels. 2. Fixes #4894, where the TargetPort on the root service was expected to match the ContainerPort on the pod backing the service. Per SMI's TrafficSplit API, the TargetPort on the root does not need to match the ContainerPort on the pod, thus allowing newer application versions to change the ports they listen on without needing to update the root service definition. Signed-off-by: Shashank Ram <shashr2204@gmail.com> * release-notes: add note on traffic split behavior Adds a note regarding the change to drop support to split traffic from a root service to pods that do not match the selector on the root service. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
shashankram
added a commit
to openservicemesh/osm-docs
that referenced
this pull request
Jul 18, 2022
This change updates the documentation to reflect the change made to the traffic split behavior in openservicemesh/osm#4902. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
shashankram
added a commit
to shashankram/osm-docs
that referenced
this pull request
Jul 18, 2022
This change updates the documentation to reflect the change made to the traffic split behavior in openservicemesh/osm#4902. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
shashankram
added a commit
to shashankram/osm-docs
that referenced
this pull request
Jul 18, 2022
This change updates the documentation to reflect the change made to the traffic split behavior in openservicemesh/osm#4902. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
shashankram
added a commit
to shashankram/osm-docs
that referenced
this pull request
Jul 18, 2022
This change updates the documentation to reflect the change made to the traffic split behavior in openservicemesh/osm#4902. Signed-off-by: Shashank Ram <shashr2204@gmail.com>
addozhang
pushed a commit
to flomesh-io/osm-docs
that referenced
this pull request
Aug 3, 2022
This change updates the documentation to reflect the change made to the traffic split behavior in openservicemesh/osm#4902. Signed-off-by: Shashank Ram <shashr2204@gmail.com> Signed-off-by: Addo.Zhang <duwasai@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
This change does the following:
Fixes the incorrect legacy behavior where traffic
directed to a root service specified in a TrafficSplit
resource can direct traffic to pods that do not match
the root service's selector. Not only was this behavior
confusing, it also significantly complicated code paths
that required special handling of this scenario that is
unintuitive. Going forward, the root service selector
must match pods for traffic splitting to those pods to
function. Existing e2e tests relying on this unsupported
behavior have been updated to correctly configure selectors
and labels on services and pods backing them. A redundant
test explicitly testing the only supported scenario after
this change has been removed. The automated demo has
also been updated to correctly configure the selector and
labels.
Fixes Specifying root service port to a port other than containerPort/TargetPort of the leaf service doesn't not work #4894, where the TargetPort on the root service was
expected to match the ContainerPort on the pod backing
the service. Per SMI's TrafficSplit API, the TargetPort
on the root does not need to match the ContainerPort
on the pod, thus allowing newer application versions
to change the ports they listen on without needing
to update the root service definition.
Testing done:
Unit tests, e2e tests
Affected area:
Please answer the following questions with yes/no.
Does this change contain code from or inspired by another project?
no
Is this a breaking change?
yes
Has documentation corresponding to this change been updated in the osm-docs repo (if applicable)? traffic-split: update root service usage osm-docs#413