-
Notifications
You must be signed in to change notification settings - Fork 370
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
SameLabels support for ACNP peer Namespace selection #4537
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4537 +/- ##
==========================================
- Coverage 73.57% 68.51% -5.06%
==========================================
Files 410 403 -7
Lines 61105 58816 -2289
==========================================
- Hits 44956 40297 -4659
- Misses 13257 15711 +2454
+ Partials 2892 2808 -84
*This pull request uses carry forward flags. Click here to find out more.
|
d9adf87
to
dbfd891
Compare
9eb0b92
to
e18f8c6
Compare
/test-multicluster-e2e |
1 similar comment
/test-multicluster-e2e |
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.
I believe SameLabels need to monitor Namespace changes, in addNamespace/updateNamespace
.
Thanks for the heads up. Updated the logic in these functions to better filter the ACNPs that need to be reprocessed |
@tnqn could you help review this? Hope to merge it by 1.11. Thanks |
/test-all |
a2da5ad
to
70eccc8
Compare
Will do in a separate PR |
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, two minor comments.
test/e2e/antreapolicy_test.go
Outdated
podIPs map[string][]string | ||
p80, p81, p8080, p8081, p8082, p8085, p6443 int32 | ||
nodes map[string]string | ||
selfNamespace *crdv1beta1.PeerNamespaces |
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.
This is a "invariant" variable defined for reuse, right? I think it's more clear to initialize its value here, instead of in a function. So do other cases like "p80, p81, p8080, p8081, p8082, p8085, p6443".
test/e2e/k8s_util.go
Outdated
_, err := k.crdClient.CrdV1alpha3().Groups(namespace).Get(context.TODO(), name, metav1.GetOptions{}) | ||
if err != nil { |
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.
I had a PR to simplify such code: no need to get a resource first as create will fail with a specific AlreadyExists error anyway.
Signed-off-by: Dyanngg <[email protected]>
Signed-off-by: Dyanngg <[email protected]>
Signed-off-by: Dyanngg <[email protected]>
Signed-off-by: Dyanngg <[email protected]>
Signed-off-by: Dyanngg <[email protected]>
Signed-off-by: Dyanngg <[email protected]>
Signed-off-by: Dyanngg <[email protected]>
In which version is this expected to be released? |
@jsalatiel It will be in the next release: v2.0 |
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 |
In NodeNetworkPolicy e2e tests, we have test the following cases: - Nodes to Nodes. We deploy two hostNetwork Pods on different Nodes. - Node to remote Pods. We deploy a hostNetwork Pod on a Node and a non-hostNetwork Pod on another Node. For case of Node to local Pods, we don't test it since the UDP probing from a non-hostNetwork Pod to the hostNetwork Pod deployed on the same Node will get a failure. The reason is that the reply packets use the local Antrea gateway IP as source IP, instead of the local Node IP, which is the destination IP of the request packets, resulting in the failure of test Pods initialization. This PR fixes the e2e test failure by reverting the test Pods initialization modified by PR antrea-io#4537. Signed-off-by: Hongliang Liu <[email protected]>
In NodeNetworkPolicy e2e tests, we have the following cases: - Nodes to Nodes. We deploy two hostNetwork Pods on different Nodes. - Node to remote Pods. We deploy a hostNetwork Pod on a Node and a non-hostNetwork Pod on another Node. For the case of Node to local Pods, we don't test it since the UDP probing from a non-hostNetwork Pod to the hostNetwork Pod deployed on the same Node will get a failure. The reason is that the reply packets use the local Antrea gateway IP as source IP, instead of the local Node IP, which is the destination IP of the request packets, resulting in the failure of test Pods initialization. This PR fixes the e2e test failure by reverting the test Pods initialization modified by PR antrea-io#4537. Signed-off-by: Hongliang Liu <[email protected]>
In NodeNetworkPolicy e2e tests, we have the following cases: - Node to Node. We deploy two hostNetwork Pods on different Nodes. - Node to remote Pods. We deploy a hostNetwork Pod on a Node and a non-hostNetwork Pod on another Node. For the case of Node to local Pods, we don't test it since the UDP probing from a non-hostNetwork Pod to the hostNetwork Pod deployed on the same Node will get a failure. The reason is that the reply packets use the local Antrea gateway IP as source IP, instead of the local Node IP, which is the destination IP of the request packets, resulting in the failure of test Pods initialization. This PR fixes the e2e test failure by reverting the test Pods initialization modified by PR antrea-io#4537. Signed-off-by: Hongliang Liu <[email protected]>
In NodeNetworkPolicy e2e tests, we have the following cases: - Node to Nodes. We deploy two hostNetwork Pods on different Nodes. - Node to remote Pods. We deploy a hostNetwork Pod on a Node and a non-hostNetwork Pod on another Node. For the case of Node to local Pods, we don't test it since the UDP probing from a non-hostNetwork Pod to the hostNetwork Pod deployed on the same Node will get a failure. The reason is that the reply packets use the local Antrea gateway IP as source IP, instead of the local Node IP, which is the destination IP of the request packets, resulting in the failure of test Pods initialization. This PR fixes the e2e test failure by reverting the test Pods initialization modified by PR antrea-io#4537. Signed-off-by: Hongliang Liu <[email protected]>
This PR adds the
sameLabels
field in ACNP peer'snamespaces
.The usecase for this field is to allow cluster admins to create ACNPs that
isolate Namespaces based on their label values. For example, if there are
numerous Namespaces in the cluster that has label tier=production and
other Namespaces with label tier=dev, admins can create a single ACNP
that says the production Namespaces can only communicate within
themselves, and same for the dev Namespaces.