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

Support TopologyAwareHints in AntreaProxy #3515

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

hongliangl
Copy link
Contributor

@hongliangl hongliangl commented Mar 24, 2022

Feature TopologyAwareHints is at Beta stage in Kubernetes v1.23, and it is
enabled by default in Kubernetes v1.24 See more
https://kubernetes.io/docs/concepts/services-networking/topology-aware-hints/.

Signed-off-by: Hongliang Liu [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2022

Codecov Report

Merging #3515 (76731c5) into main (40a952b) will decrease coverage by 0.07%.
The diff coverage is 16.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3515      +/-   ##
==========================================
- Coverage   64.00%   63.93%   -0.08%     
==========================================
  Files         293      294       +1     
  Lines       43300    43406     +106     
==========================================
+ Hits        27716    27750      +34     
- Misses      13340    13417      +77     
+ Partials     2244     2239       -5     
Flag Coverage Δ
kind-e2e-tests 50.46% <16.08%> (-0.01%) ⬇️
unit-tests 44.40% <0.00%> (-0.13%) ⬇️

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

Impacted Files Coverage Δ
pkg/agent/proxy/endpoints.go 67.46% <ø> (ø)
pkg/agent/proxy/endpointslicecache.go 0.00% <0.00%> (ø)
pkg/agent/proxy/topology.go 0.00% <0.00%> (ø)
pkg/features/antrea_features.go 11.11% <ø> (ø)
pkg/agent/proxy/proxier.go 58.62% <30.26%> (-4.31%) ⬇️
pkg/agent/flowexporter/exporter/certificate.go 50.00% <0.00%> (-16.67%) ⬇️
...r/ipseccertificate/ipsec_certificate_controller.go 61.56% <0.00%> (-1.96%) ⬇️
pkg/agent/flowexporter/exporter/exporter.go 77.97% <0.00%> (-0.75%) ⬇️
pkg/agent/openflow/pipeline.go 73.03% <0.00%> (-0.57%) ⬇️
pkg/agent/controller/trafficcontrol/controller.go 82.21% <0.00%> (-0.43%) ⬇️
... and 13 more

@hongliangl hongliangl added area/proxy Issues or PRs related to proxy functions in Antrea action/release-note Indicates a PR that should be included in release notes. labels Mar 31, 2022
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

Could I have a rough ideas what changes from copied from kube-proxy, what are Antrea specific?

# this flag will not take effect.
# EndpointSlice: false

# Enable TopologyAwareHints in AntreaProxy. This requires AntreaProxy and EndpointSlice to be
# enabled, otherwise this flag will not take effect.
# TopologyAwareHints: false
Copy link
Contributor

Choose a reason for hiding this comment

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

So, this is a feature gate in K8s too? I am trying to understand do we need to add individual feature gates (for code isolation consideration), or just need a config flag to to enable/disable the feature, or nothing but enable it by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is also a feature gate in K8s. If we don't need this flag, I think we should also remove EndpointSlice feature gate in Antrea Agent since it is also a feature gate in K8s. I don't have a idea how to decide that if we need a feature gate in Antrea for the code that has a feature gate in K8s.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Probably let us keep it a feature gate for now.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps EndpointSlice should be a config as it's actually used to determine which API agent will use, and will be needed until we no longer support K8s versions that can disable EndpointSlice feature.
For TopologyAwareHints, I assume if the feature is disabled on K8s side, there will be no topology hint, right? If yes, we could just rely on the content of the endpoints. If there is hint, meaning feature is enabled, we implement it. If there isn't a hint, meaning feature is disabled, we don't do anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For TopologyAwareHints, I assume if the feature is disabled on K8s side, there will be no topology hint, right?

Yes

If there is hint, meaning feature is enabled, we implement it. If there isn't a hint, meaning feature is disabled, we don't do anything.

Yes, if there is no hint available, we don't do anything.

@hongliangl hongliangl added this to the Antrea v1.7 release milestone Apr 8, 2022
@tnqn tnqn added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 8, 2022
@hongliangl
Copy link
Contributor Author

/test-all-features-conformance
/test-conformance
/test-e2e
/test-flexible-ipam-e2e
/test-multicluster-e2e
/test-networkpolicy
/test-windows-conformance
/test-windows-e2e
/test-windows-networkpolicy
/test-windows-proxyall-e2e
/test-integration

@hongliangl hongliangl force-pushed the topology-hint branch 2 times, most recently from 50515f9 to cdae534 Compare April 20, 2022 23:47
@hongliangl hongliangl force-pushed the topology-hint branch 2 times, most recently from 240c1af to ae92699 Compare April 28, 2022 02:58
@hongliangl hongliangl requested review from tnqn and jianjuns April 28, 2022 02:59
@hongliangl hongliangl removed this from the Antrea v1.7 release milestone May 13, 2022
@jianjuns jianjuns requested a review from xliuxu June 13, 2022 17:09
build/charts/antrea/conf/antrea-agent.conf Outdated Show resolved Hide resolved
pkg/agent/proxy/topology.go Outdated Show resolved Hide resolved
pkg/agent/proxy/proxier.go Show resolved Hide resolved
pkg/agent/proxy/proxier.go Show resolved Hide resolved
@tnqn tnqn added this to the Antrea v1.8 release milestone Jun 15, 2022
docs/feature-gates.md Outdated Show resolved Hide resolved
docs/feature-gates.md Outdated Show resolved Hide resolved
docs/feature-gates.md Outdated Show resolved Hide resolved
hack/generate-manifest.sh Outdated Show resolved Hide resolved
pkg/agent/proxy/endpointslicecache.go Show resolved Hide resolved
pkg/agent/proxy/endpointslicecache.go Outdated Show resolved Hide resolved
pkg/features/antrea_features.go Outdated Show resolved Hide resolved
@hongliangl hongliangl changed the title Support TopologyAwareHints in Antrea proxy Support TopologyAwareHints in AntreaProxy Jun 21, 2022
@hongliangl hongliangl force-pushed the topology-hint branch 2 times, most recently from 09bac5c to 9a9b30d Compare June 21, 2022 10:39
@hongliangl hongliangl requested review from tnqn and xliuxu June 24, 2022 01:04
tnqn
tnqn previously approved these changes Jun 24, 2022
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM. Have you tested the feature with upstream test about it?

@hongliangl
Copy link
Contributor Author

LGTM. Have you tested the feature with upstream test about it?
@tnqn Not yet, I'll verify it manually or add some e2e tests if possible.

@hongliangl hongliangl force-pushed the topology-hint branch 3 times, most recently from b4ec8f3 to ebb2f25 Compare June 29, 2022 15:43
@hongliangl hongliangl requested a review from tnqn June 29, 2022 15:43
@hongliangl
Copy link
Contributor Author

/test-all

@hongliangl
Copy link
Contributor Author

hongliangl commented Jun 29, 2022

@tnqn added some unit tests and verified the feature manually, and it works as expected.

Feature TopologyAwareHints is at Beta stage in Kubernetes v1.23, and it is
enabled by default in Kubernetes v1.24 See more
https://kubernetes.io/docs/concepts/services-networking/topology-aware-hints/.

Signed-off-by: Hongliang Liu <[email protected]>
@hongliangl
Copy link
Contributor Author

/test-all

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn
Copy link
Member

tnqn commented Jul 6, 2022

@jianjuns @xliuxu could you check if your comments have been addressed and if it looks good to you now?

@jianjuns
Copy link
Contributor

jianjuns commented Jul 6, 2022

@jianjuns @xliuxu could you check if your comments have been addressed and if it looks good to you now?

I am good. @tnqn

@tnqn tnqn merged commit db0fb50 into antrea-io:main Jul 7, 2022
@hongliangl hongliangl deleted the topology-hint branch August 23, 2023 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes. area/proxy Issues or PRs related to proxy functions in Antrea kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants