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

Automated cherry pick of #3360: Realize Egress for a Pod once its network is created #3378

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Mar 2, 2022

Cherry pick of #3360 on release-1.5.

#3360: Realize Egress for a Pod once its network is created

For details on the cherry pick process, see the cherry pick requests page.

Previously antrea-controller included a Pod in an EgressGroup only when
its IP has been presented in K8s API. If a Pod tries to access external
right after it's up, Node IP will be used as the SNAT IP even when an
Egress applying to it has been created because its Pod IP may haven't
been reported to K8s API or antrea-controller may haven't included the
Pod in the EgressGroup.

This patch fixes it by making CNIServer notify EgressController that it
has processed CNI ADD request of a Pod, then EgressController can
reconcile the corresponding Egress immediately, instead of waiting for
the Pod to be reported to K8s API. As NetworkPolicyController relies on
that event as well, we introduce a channel implementation which supports
multiple subscribers.

Fixes antrea-io#3361

Signed-off-by: Quan Tian <[email protected]>
@tnqn tnqn added the kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release label Mar 2, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2022

Codecov Report

Merging #3378 (e6c44e1) into release-1.5 (dec6ab9) will decrease coverage by 7.06%.
The diff coverage is 95.71%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-1.5    #3378      +/-   ##
===============================================
- Coverage        59.89%   52.82%   -7.07%     
===============================================
  Files              331      464     +133     
  Lines            28470    54704   +26234     
===============================================
+ Hits             17052    28899   +11847     
- Misses            9542    23317   +13775     
- Partials          1876     2488     +612     
Flag Coverage Δ
e2e-tests 52.32% <90.00%> (?)
integration-tests 34.00% <ø> (?)
kind-e2e-tests 47.92% <77.55%> (-0.05%) ⬇️
unit-tests 41.41% <89.79%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/agent/types/networkpolicy.go 81.08% <ø> (-2.26%) ⬇️
pkg/util/channel/channel.go 90.32% <90.32%> (ø)
pkg/agent/cniserver/pod_configuration.go 50.14% <100.00%> (-3.55%) ⬇️
pkg/agent/cniserver/server.go 59.19% <100.00%> (-6.47%) ⬇️
pkg/agent/controller/egress/egress_controller.go 72.26% <100.00%> (+33.45%) ⬆️
pkg/agent/controller/networkpolicy/cache.go 85.08% <100.00%> (-1.55%) ⬇️
...ntroller/networkpolicy/networkpolicy_controller.go 68.85% <100.00%> (-2.49%) ⬇️
pkg/controller/egress/controller.go 62.19% <100.00%> (-26.26%) ⬇️
pkg/agent/cniserver/pod_configuration_linux.go 26.31% <0.00%> (-40.36%) ⬇️
pkg/controller/ipam/antrea_ipam_controller.go 48.71% <0.00%> (-31.57%) ⬇️
... and 433 more

@tnqn
Copy link
Member Author

tnqn commented Mar 2, 2022

/test-all

@tnqn tnqn requested a review from jianjuns March 2, 2022 04:51
@tnqn
Copy link
Member Author

tnqn commented Mar 2, 2022

/test-ipv6-e2e
/test-ipv6-only-e2e

@tnqn tnqn merged commit 318ccde into antrea-io:release-1.5 Mar 3, 2022
@tnqn tnqn deleted the automated-cherry-pick-of-#3360-upstream-release-1.5 branch March 3, 2022 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants