-
Notifications
You must be signed in to change notification settings - Fork 387
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
ToServices support #2755
ToServices support #2755
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2755 +/- ##
==========================================
+ Coverage 61.59% 61.64% +0.05%
==========================================
Files 283 283
Lines 23644 23729 +85
==========================================
+ Hits 14563 14628 +65
- Misses 7512 7524 +12
- Partials 1569 1577 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
cab7532
to
6606fb6
Compare
6606fb6
to
58bbc3a
Compare
064c606
to
4f4ea69
Compare
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.
The commit message / PR description should mention the "caveat" of this approach: the policies will not be enforced when appliedTo workloads connect to Service Endpoints directly.
4f4ea69
to
96335a1
Compare
Updated the commit message and the PR description. |
195d2ee
to
7e2299d
Compare
7e2299d
to
fa5820f
Compare
type ServiceReference struct { | ||
// Name of the Service | ||
Name string `json:"name,omitempty"` | ||
// Namespace of the Service |
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.
maybe add the requirements of these? Name is required. Namespace is required for ACNP usage
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.
ACNP and ANP both use this struct. I'm not sure how to do "Namespace is required for ACNP usage". But I have this requirement set in crds.yml.
b9df198
to
b38153d
Compare
ac3d046
to
696cfa5
Compare
55044ec
to
e73b47f
Compare
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.
The commit message format wouldn't look nice in many git tools. Could you follow the above link to improve it? More specifically, please wrap the body at 72 characters.
e73b47f
to
2755fe3
Compare
2755fe3
to
b5865e9
Compare
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.
Code LGTM. I suggest to remove the part that talks about the old approach from the commit message as it's never merged to main branch and could confuse people to think the PR is updating the implementation of a feature that was implemented in another way. The commit message could just focus on what this PR does.
This PR adds ToServices feature, which allows users to apply an ACNP/ANP on a Service. This PR uses groupID assigned to the Service by AntreaProxy to match traffic, which means that ToServices can only be used when AntreaProxy is enabled and this Service must have at least one clusterIP. Also, this PR use groupID to match traffic, thus the policies will not be enforced when appliedTo workloads connect to Service Endpoints directly. In order to enforce policies on directly Endpoints traffic, one fallback is using ClusterGroup with ServiceReference added in PR antrea-io#1797. What this PR did: 1. Add ToServices field in ACNP and ANP. 2. In ServiceLBTable, load OVS groupID to reg7. 3. Use OVS groupID of Service to do the conj match in the egress table. 4. Add a channel between proxier and networkpolicy controller for Service groupID update events. Signed-off-by: wgrayson <wgrayson@vmware.com>
b5865e9
to
d955364
Compare
@tnqn Good suggestion. Commit message changed. |
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
/test-all |
e2e failed:
|
@tnqn The reason for those failures is that before k8s v1.20 null values for fields that don't specify the nullable flag won't be pruned. So if we use So I pushed a commit making We didn't meet this issue on Thanks for @antoninbas 's help during the investigation. |
/test-all |
fe086ee
to
d994630
Compare
/test-all |
Signed-off-by: wgrayson <wgrayson@vmware.com>
d994630
to
59205cf
Compare
/test-all |
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
/test-ipv6-e2e |
This PR adds
ToServices
feature, which allows users to apply an ACNP/ANP on a Service.Use this PR to replace PR #2538 with the new approach brought up in PR #2538.
The new approach will use groupID assigned to the Service by AntreaProxy to match traffic, which means that
ToServices
can only be used when AntreaProxy is enabled and this Service must have at least one clusterIP.Also, this implementation use groupID to match traffic, thus the policies will not be enforced when appliedTo workloads connect to Service Endpoints directly. In order to enforce policies on directly Endpoints traffic, one fallback is using
ClusterGroup
withServiceReference
added in PR #1797.Signed-off-by: wgrayson wgrayson@vmware.com