Skip to content
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

Multus network policies #1113

Merged

Conversation

zeeke
Copy link
Member

@zeeke zeeke commented May 16, 2022

This PR introduces multinetworkpolicy feature and e2e tests of it on SRIOV interface.
It contains some skipped tests that need some fixed on implementation side.

Depends on

@openshift-ci openshift-ci bot requested review from ijolliffe and jlojosnegros May 16, 2022 11:51
@zeeke zeeke force-pushed the multus-network-policies branch 3 times, most recently from 3f71d7d to ed27370 Compare May 16, 2022 15:16
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2022
@zeeke zeeke force-pushed the multus-network-policies branch from ed27370 to c4566a7 Compare May 18, 2022 06:55
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 18, 2022
@zeeke zeeke force-pushed the multus-network-policies branch 3 times, most recently from 1996714 to 0550184 Compare May 18, 2022 15:59
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 26, 2022
@zeeke zeeke force-pushed the multus-network-policies branch from 0550184 to 590c456 Compare May 27, 2022 07:21
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2022
@zeeke
Copy link
Member Author

zeeke commented May 27, 2022

/retest

@zeeke
Copy link
Member Author

zeeke commented May 27, 2022

/hold

Wait for openshift/cluster-network-operator#1443

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 27, 2022
Copy link
Member

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

great PR!

I left some comments there

},
{
"registry": "quay.io/openshift-kni/",
"image": "dpdk:4.10"
"image": "dpdk:4.11"
Copy link
Member

Choose a reason for hiding this comment

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

please open this in a separate PR so we can merge it

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure: #1132

@@ -8,8 +8,8 @@ export failures=()

#env variables needed for the containerized version
export TEST_POD_IMAGES_REGISTRY="${TEST_POD_IMAGES_REGISTRY:-quay.io/openshift-kni/}"
export TEST_POD_CNF_TEST_IMAGE="${TEST_POD_CNF_TEST_IMAGE:-cnf-tests:4.8}"
export TEST_POD_DPDK_TEST_IMAGE="${TEST_POD_DPDK_TEST_IMAGE:-dpdk:4.8}"
export TEST_POD_CNF_TEST_IMAGE="${TEST_POD_CNF_TEST_IMAGE:-cnf-tests:4.11}"
Copy link
Member

Choose a reason for hiding this comment

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

please open this in a separate PR so we can merge it before this one

Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above: #1132

@@ -44,6 +44,7 @@ require (

require (
github.com/google/go-cmp v0.5.7
github.com/k8snetworkplumbingwg/multi-networkpolicy v0.0.0-20220419111628-220baf5d60c1
Copy link
Member

Choose a reason for hiding this comment

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

please move it down and use the same method as the sriov network operator for example to pin the right version

github.com/k8snetworkplumbingwg/sriov-network-operator => github.com/openshift/sriov-network-operator v0.0.0-20211207043958-2bfa00ead503 // release-4.10

Copy link
Member Author

Choose a reason for hiding this comment

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

I can move it down in the file, in the "// Test deps section", but we still need to refer github.com/k8snetworkplumbingwg/multi-networkpolicy, as there are no downstream flavour of that repository: it's the API one.

Does it make sense?

cnf-tests/testsuites/pkg/images/images.go Outdated Show resolved Hide resolved

// Add 4 containers to the pod for netcat server. 2 for each transport protocol (TCP/UDP) for each
// port in (5555/6666)
func redefineWithNetcatServers(pod *corev1.Pod) *corev1.Pod {
Copy link
Member

Choose a reason for hiding this comment

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

is this function in use?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, in createPodsInNamespace(...)

https://github.com/openshift-kni/cnf-features-deploy/pull/1113/files#diff-b96c3f1d12439337ea75489fadce58f869013344d564ecbb6731fc0ba93a5f67R694

As netcat servers installed by this function are intended to be used by the ReachMatcher, I'll put it in reachmatcher.go file.

Expect(err).ToNot(HaveOccurred())

networkAttachDef := netattdefv1.NetworkAttachmentDefinition{}
waitForObject(
Copy link
Member

Choose a reason for hiding this comment

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

I think we have a function for this already in pkg if not I think we should move it there.

you also add the networkAttachDef scheme into the global client so you can use it from there no need to use it from the sriovClient

Copy link
Member Author

@zeeke zeeke Jun 13, 2022

Choose a reason for hiding this comment

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

Can't find anything similar.

Also, not sure why but it works also with global client without adding the scheme to it. It probably fallbacks to a not structured client.

Moved to pkg/client/wait.go WaitForObject(...)


It("enforce multiple stacked policies with overlapping selector [nsX_podA <=> (nsY/* OR */podB)]", func() {

Skip("Stacked policies are not yet supported")
Copy link
Member

Choose a reason for hiding this comment

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

please add a comment with a TODO: and a bz link


It("enforce multiple stacked policies with overlapping selector and different ports (*/podB ==> nsX/podA:5555 , */podC ==> nsX/podA:6666)", func() {

Skip("Stacked policies are not yet supported")
Copy link
Member

Choose a reason for hiding this comment

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

please add a comment with a TODO: and a bz link

@zeeke zeeke force-pushed the multus-network-policies branch 10 times, most recently from 3c6f29c to c971907 Compare June 13, 2022 12:54
@zeeke zeeke force-pushed the multus-network-policies branch 2 times, most recently from c43c7ef to 1f556ee Compare June 16, 2022 12:54
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 7, 2022
@zeeke
Copy link
Member Author

zeeke commented Sep 7, 2022

ci/prow/e2e-gcp-ovn failures should be fixed by:

@zeeke zeeke force-pushed the multus-network-policies branch from eecccb2 to 86dc0c2 Compare September 15, 2022 14:38
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2022
Pod logs, pod's specs, node information and custom
resources can be dumped in parallel, as the write on different files.

Signed-off-by: Andrea Panattoni <[email protected]>
IpTables tool is needed by multinetworkpolicy feature tests
to inspect pods iptables.

Signed-off-by: Andrea Panattoni <[email protected]>
Dependency is about API project. v1beta1 is the version actually
supported by multus-networkpolicy-iptables implementation.

Signed-off-by: Andrea Panattoni <[email protected]>
Add `multinetworkpolicy` to the list of default feature in Makefile.

Add kustomization files to deploy the feature in `deploy` and `ci` envs.

Signed-off-by: Andrea Panattoni <[email protected]>
Also CreateDPDKWorkload to use the new function.

Signed-off-by: Andrea Panattoni <[email protected]>
@zeeke zeeke force-pushed the multus-network-policies branch from 86dc0c2 to 6baf3a2 Compare September 19, 2022 08:18
Add e2esuite/multinetworkpolicy suite with basic test cases. Inspiration
has been taken from official test on NetworkPolicy
(ses github.com/kubernetes/kubernetes package
test/e2e/network/netpol)

Add suite to unnamed import in test_suite_test.go to add to the
main suite.

Add the multinetworkpolicy scheme to test client.

Update k8sreporter to dump information about multinetworkpolicy
namespaces, pods and CRs.

Add validation suite to check if the feature has been deployed.

Bump used cnf-tests image version to 4.11 as new tests require
netcat binary to be installed on pods.

Signed-off-by: Andrea Panattoni <[email protected]>
@zeeke zeeke force-pushed the multus-network-policies branch from 6baf3a2 to 5e08607 Compare September 19, 2022 14:41
@zeeke
Copy link
Member Author

zeeke commented Sep 20, 2022

Copy link
Member

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

amazing work thanks @zeeke !

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SchSeba, zeeke

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 21, 2022
@SchSeba
Copy link
Member

SchSeba commented Sep 22, 2022

/retest

if the only failing test will be performance I will override this PR

@zeeke
Copy link
Member Author

zeeke commented Oct 7, 2022

/retest-required

@zeeke
Copy link
Member Author

zeeke commented Oct 10, 2022

Failing tests in ci/prow/e2e-gcp-ovn job are not related to this PR:

Summarizing 2 Failures:
[Fail] metallb MetalLB deploy [It] should have MetalLB pods in running state 
/go/src/github.com/openshift-kni/cnf-features-deploy/vendor/github.com/metallb/metallb-operator/test/e2e/functional/tests/e2e.go:79
[Fail] metallb MetalLB contains incorrect data Correct and incorrect MetalLB resources coexist [BeforeEach] should have correct statuses 
/go/src/github.com/openshift-kni/cnf-features-deploy/vendor/github.com/metallb/metallb-operator/test/e2e/functional/tests/e2e.go:188
Ran 66 of 214 Specs in 1395.804 seconds
FAIL! -- 64 Passed | 2 Failed | 0 Pending | 148 Skipped

/override ci/prow/e2e-gcp-ovn

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 10, 2022

@zeeke: zeeke unauthorized: /override is restricted to Repo administrators, approvers in top level OWNERS file, and the following github teams:.

In response to this:

Failing tests in ci/prow/e2e-gcp-ovn job are not related to this PR:

Summarizing 2 Failures:
[Fail] metallb MetalLB deploy [It] should have MetalLB pods in running state 
/go/src/github.com/openshift-kni/cnf-features-deploy/vendor/github.com/metallb/metallb-operator/test/e2e/functional/tests/e2e.go:79
[Fail] metallb MetalLB contains incorrect data Correct and incorrect MetalLB resources coexist [BeforeEach] should have correct statuses 
/go/src/github.com/openshift-kni/cnf-features-deploy/vendor/github.com/metallb/metallb-operator/test/e2e/functional/tests/e2e.go:188
Ran 66 of 214 Specs in 1395.804 seconds
FAIL! -- 64 Passed | 2 Failed | 0 Pending | 148 Skipped

/override ci/prow/e2e-gcp-ovn

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zeeke
Copy link
Member Author

zeeke commented Oct 10, 2022

/retest-required

@fedepaol
Copy link
Member

/override ci/prow/e2e-gcp-ovn
Failure is related to metallb which will be investigated

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 10, 2022

@fedepaol: Overrode contexts on behalf of fedepaol: ci/prow/e2e-gcp-ovn

In response to this:

/override ci/prow/e2e-gcp-ovn
Failure is related to metallb which will be investigated

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 10, 2022

@zeeke: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-ran-profile 5e08607 link false /test e2e-gcp-ran-profile

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@fedepaol
Copy link
Member

/override ci/prow/e2e-gcp-ovn

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 11, 2022

@fedepaol: Overrode contexts on behalf of fedepaol: ci/prow/e2e-gcp-ovn

In response to this:

/override ci/prow/e2e-gcp-ovn

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-merge-robot openshift-merge-robot merged commit b636432 into openshift-kni:master Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants