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

The implementation of network policy controller #392

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

heypnus
Copy link
Contributor

@heypnus heypnus commented Nov 16, 2023

This patch will add the network policy controller to handle the network
policy event and CRUD the related security policy on the NSX side.

It will convert the network policy defination to security policy CR internally,
then reuse the logic to handle security policy CR to create the NSX security
policy. So we add a new flag createdFor in the security policy module.

Testing done:

Create and update for the network policy:
kubectl apply -f test/e2e/manifest/testNetworkPolicy/np_simple.yaml
kubectl apply -f test/e2e/manifest/testNetworkPolicy/np_simple2.yaml

cmd/main.go Outdated Show resolved Hide resolved
pkg/controllers/networkpolicy/networkpolicy_controller.go Outdated Show resolved Hide resolved
pkg/controllers/networkpolicy/networkpolicy_controller.go Outdated Show resolved Hide resolved
pkg/controllers/networkpolicy/networkpolicy_controller.go Outdated Show resolved Hide resolved
cmd/main.go Outdated Show resolved Hide resolved
pkg/controllers/networkpolicy/networkpolicy_controller.go Outdated Show resolved Hide resolved
pkg/controllers/networkpolicy/networkpolicy_controller.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/store.go Outdated Show resolved Hide resolved
pkg/util/utils.go Outdated Show resolved Hide resolved
pkg/util/utils.go Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
@heypnus heypnus changed the base branch from vpc_dev to main January 4, 2024 09:31
@heypnus heypnus changed the base branch from main to vpc_dev January 4, 2024 09:31
@heypnus heypnus force-pushed the np/controller branch 4 times, most recently from 0991612 to 03d0714 Compare January 11, 2024 08:47
@heypnus heypnus changed the base branch from vpc_dev to main January 11, 2024 08:47
@heypnus heypnus force-pushed the np/controller branch 2 times, most recently from 4f8a605 to c2e6fab Compare January 11, 2024 09:47
@heypnus heypnus force-pushed the np/controller branch 2 times, most recently from e9eb12b to 1533826 Compare January 15, 2024 10:46
@heypnus
Copy link
Contributor Author

heypnus commented Jan 17, 2024

/e2e

@heypnus heypnus force-pushed the np/controller branch 4 times, most recently from 54b4c91 to ab8739f Compare January 17, 2024 11:03
@heypnus
Copy link
Contributor Author

heypnus commented Jan 18, 2024

/e2e

pkg/nsx/services/securitypolicy/store_test.go Show resolved Hide resolved
pkg/nsx/services/securitypolicy/store_test.go Show resolved Hide resolved
pkg/util/utils.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
pkg/nsx/services/common/types.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Show resolved Hide resolved
@heypnus heypnus force-pushed the np/controller branch 4 times, most recently from f062665 to 711c770 Compare January 24, 2024 07:19
@heypnus heypnus changed the title Basic implementation of network policy controller The implementation of network policy controller Jan 24, 2024
pkg/util/utils.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
@heypnus heypnus force-pushed the np/controller branch 3 times, most recently from 242d6d1 to 90fbe77 Compare January 26, 2024 05:24
This patch will add the network policy controller to handle the network
policy event and CRUD the related security policy on the NSX side.

It will convert the network policy defination to security policy CR internally,
then reuse the logic to handle security policy CR to create the NSX security
policy. So we add a new flag createdFor in the security policy module.

Testing done:

Create and update for the network policy:
  kubectl apply -f test/e2e/manifest/testNetworkPolicy/np_simple.yaml
  kubectl apply -f test/e2e/manifest/testNetworkPolicy/np_simple2.yaml
@heypnus heypnus merged commit 5be019e into vmware-tanzu:main Jan 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants