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

Add selecting egress's owner node and assign egress-ip to owner node #2225

Closed
wants to merge 2 commits into from

Conversation

wenqiq
Copy link
Contributor

@wenqiq wenqiq commented May 30, 2021

Add selecting egress's owner node and assign egress-ip to owner node

1.Assign a owner node for egress which with a valid externalIPPool

2.Add egress status of api, when egress has assigned a owner node and egressIP has assigned,
the egress status will updated, egress status is the owner node name

For #2128

@codecov-commenter
Copy link

codecov-commenter commented May 30, 2021

Codecov Report

Merging #2225 (a7fe01a) into main (152b7ea) will decrease coverage by 0.33%.
The diff coverage is 37.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2225      +/-   ##
==========================================
- Coverage   61.75%   61.41%   -0.34%     
==========================================
  Files         278      281       +3     
  Lines       21255    21581     +326     
==========================================
+ Hits        13125    13254     +129     
- Misses       6770     6943     +173     
- Partials     1360     1384      +24     
Flag Coverage Δ
kind-e2e-tests 52.11% <0.00%> (-0.78%) ⬇️
unit-tests 41.36% <37.73%> (-0.06%) ⬇️

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

Impacted Files Coverage Δ
pkg/agent/controller/egress/egress_controller.go 34.90% <0.00%> (-5.89%) ⬇️
...ent/controller/egress/ip_assign_advertise_linux.go 0.00% <0.00%> (ø)
pkg/controller/metrics/prometheus.go 4.34% <ø> (ø)
pkg/agent/util/ndp/ndp.go 28.07% <28.07%> (ø)
pkg/agent/memberlist/cluster.go 82.72% <82.72%> (ø)
pkg/controller/networkpolicy/status_controller.go 85.16% <0.00%> (-1.94%) ⬇️
pkg/agent/flowexporter/exporter/exporter.go 77.98% <0.00%> (-1.61%) ⬇️
pkg/agent/proxy/endpoints.go 65.00% <0.00%> (-1.25%) ⬇️
pkg/flowaggregator/flowaggregator.go 58.54% <0.00%> (ø)
... and 8 more

@wenqiq wenqiq changed the title Add select egress's owner node and assign egress-ip to node for egress failover feature Add selecting egress's owner node and assign egress-ip to node for egress failover feature May 31, 2021
@wenqiq wenqiq force-pushed the egress-policy-failover branch 6 times, most recently from f204201 to 0bbc99f Compare June 3, 2021 17:15
@wenqiq wenqiq marked this pull request as ready for review June 3, 2021 17:22
@wenqiq wenqiq requested review from tnqn, xliuxu and jianjuns June 3, 2021 17:22
@wenqiq wenqiq force-pushed the egress-policy-failover branch 4 times, most recently from a7fe01a to 2135405 Compare June 4, 2021 14:25
@wenqiq wenqiq force-pushed the egress-policy-failover branch 2 times, most recently from f3a9c29 to a3de615 Compare June 15, 2021 01:12
A cluster will created in background when egress feature turn on,
once local node labels matches the ExternalIPPool nodeSelectors,
it will join cluster, in the same way, local node will leave cluster
when node labels or ExternalIPPool nodeSelectors updated and not matched.

Each node joined in cluster hold the same consistent hash map,
when new node join cluster, add node name as new key to the hash ring,
when a node leave the cluster, the consistent hash map will update.

Signed-off-by: wenqiq <wenqiq@vmware.com>
@wenqiq wenqiq force-pushed the egress-policy-failover branch from a3de615 to a86be3b Compare June 16, 2021 01:31
@wenqiq wenqiq changed the title Add selecting egress's owner node and assign egress-ip to node for egress failover feature Add selecting egress's owner node and assign egress-ip to owner node Jun 16, 2021
1.Assign a owner node for egress which with a valid externalIPPool
2.Add egress status of api, when egress has assigned a owner node and egressIP has assigned,
the egress status will updated, egress status is the owner node name

Signed-off-by: wenqiq <wenqiq@vmware.com>
@wenqiq wenqiq force-pushed the egress-policy-failover branch from a86be3b to 4692284 Compare June 16, 2021 01:54
if err != nil {
return err
}
if err := assignEgressIP(addr, link); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

could be simplified by return assignEgressIP(addr, link)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, could you please help to review this PR #2186? Some code has been deprecated in this PR.

@wenqiq wenqiq removed request for tnqn and jianjuns June 30, 2021 12:25
@wenqiq wenqiq marked this pull request as draft June 30, 2021 12:25
@wenqiq
Copy link
Contributor Author

wenqiq commented Jul 14, 2021

All codes have been merged in PR #2186. Close this PR.

@wenqiq wenqiq closed this Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants