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 document for BGPPolicy #6524

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

hongliangl
Copy link
Contributor

No description provided.

@hongliangl hongliangl added the kind/documentation Categorizes issue or PR as related to a documentation. label Jul 12, 2024
@hongliangl hongliangl added this to the Antrea v2.1 release milestone Jul 12, 2024
@hongliangl hongliangl added the area/transit/bgp Issues or PRs related to BGP support. label Jul 12, 2024
@hongliangl hongliangl marked this pull request as ready for review July 15, 2024 02:58
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
jianjuns
jianjuns previously approved these changes Jul 17, 2024
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.

LGTM

luolanzone
luolanzone previously approved these changes Jul 19, 2024
docs/bgp-policy.md Outdated Show resolved Hide resolved
@hongliangl hongliangl force-pushed the 20240712-bgp-document branch 2 times, most recently from 8ce56c4 to 3018739 Compare July 22, 2024 03:49
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Show resolved Hide resolved
@hongliangl hongliangl requested a review from jianjuns July 23, 2024 04:44
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

Only minor comments left, otherwise lgtm

docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
Comment on lines +99 to +102
- All Nodes can advertise all ClusterIPs, respecting `internalTrafficPolicy`. If `internalTrafficPolicy` is set to
`Local`, a Node will only advertise ClusterIPs with at least one local Endpoint.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit surprising, because it feels like internalTrafficPolicy is not something that should impact traffic coming from external routers. However, ClusterIPs were not meant to be externally routable anyway so it's already a bit of an unusual situation. cc @tnqn. If this is the behavior that was agreed upon, then this is fine by me.

Copy link
Member

Choose a reason for hiding this comment

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

Right, I thought about this and didn't figure out a better implementation. I think in practice users will only advertise ClusterIPs when they don't have any ExternalIPs and LoadBalancerIPs, and they intend to reduce costs and improve performance by setting the internal traffic policy to local, then it seems fine to only advertise from Nodes that have local Pods to achieve the same goals for external traffic.

Besides, I suppose making external-to-clusterIP traffic not enforce internalTrafficPolicy would impact Antrea Proxy's implementation a lot.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose making external-to-clusterIP traffic not enforce internalTrafficPolicy would impact Antrea Proxy's implementation a lot.

makes sense

docs/bgp-policy.md Outdated Show resolved Hide resolved
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

Need to make adjustments to my earlier suggestions for the BGP router ID section, after reviewing the actual code. I didn't realize earlier that the annotation had to be an actual IPv4 address string (a.b.c.d) and I though a 32-bit integer was to be used.

docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
@antoninbas
Copy link
Contributor

@hongliangl The doc should probably mention the BGP secret, as pointed out by @luolanzone in another PR review

@hongliangl hongliangl force-pushed the 20240712-bgp-document branch 2 times, most recently from 16fdf50 to 5f0e135 Compare July 23, 2024 20:35
@hongliangl
Copy link
Contributor Author

@hongliangl The doc should probably mention the BGP secret, as pointed out by @luolanzone in another PR review

Added

Comment on lines 134 to 135
BGP authentication ensures that BGP sessions are established and maintained only with legitimate peers. Antrea supports
BGP authentication by leveraging a Kubernetes Secret, `antrea-bgp-passwords`, to store authentication passwords.
Copy link
Contributor

Choose a reason for hiding this comment

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

For the second sentence, I suggest:

Users can provide authentication passwords for the different BGP peering sessions by storing them in a Kubernetes secret. The secret must be defined in the same Namespace as Antrea (kube-system by default) and must be named antrea-bgp-passwords.

docs/bgp-policy.md Outdated Show resolved Hide resolved
docs/bgp-policy.md Outdated Show resolved Hide resolved
Comment on lines 140 to 141
the password for that BGP peer. If a key for a BGP peer does not exist in the Secret, the peer is considered unconfigured
for that one.
Copy link
Contributor

Choose a reason for hiding this comment

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

For the last sentence:

If a given BGP peer does not have a corresponding key in the Secret data, then authentication is considered disabled for that peer.

docs/bgp-policy.md Outdated Show resolved Hide resolved
@hongliangl hongliangl force-pushed the 20240712-bgp-document branch 2 times, most recently from 035c96b to 2bd84a2 Compare July 24, 2024 08:58
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM

docs/bgp-policy.md Outdated Show resolved Hide resolved
antoninbas
antoninbas previously approved these changes Jul 25, 2024
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM

luolanzone
luolanzone previously approved these changes Jul 25, 2024
Copy link
Contributor

@luolanzone luolanzone left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 123 to 124
1. If the `node.antrea.io/bgp-router-id` annotation is present on the Node and its value is a valid IPv4 address string,
we will use the provided value.
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't match the implementation which always uses Node IPv4 when there is one.

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 for reminding me about that. I have corrected it.

Copy link
Contributor

@antoninbas antoninbas Jul 25, 2024

Choose a reason for hiding this comment

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

Thanks for catching this @tnqn. I'm partially to blame here, as I suggested the previous wording without double-checking the implementation.
I don't want to block the BGP PRs for this, but the implementation doesn't make much sense to me. I see no reason why the annotation should not be honored in the IPv4 case. If anything, that just creates confusion. RFC 6286 relaxes the definition of the BGP router ID, and I don't think we need to "force" the ID to be the Node IP in the IPv4 case.

Copy link
Contributor

Choose a reason for hiding this comment

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

(I am perfectly fine having this discussion and potentially making this change post v2.1 release btw)

Copy link
Member

Choose a reason for hiding this comment

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

@antoninbas I agree with you. I wondered why not to handle IPv4/IPv6 consitently but didn't want to ask for a change in the implementation given the tight schedule. We could unify them in 2.2.

Copy link
Contributor

Choose a reason for hiding this comment

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

I created #6550 yesterday to track this

3. Otherwise, for IPv6-only clusters, a 32-bit integer will be generated by hashing the Node name, then converted to the
string representation of an IPv4 address.

After this selection process, the `node.antrea.io/bgp-router-id` annotation is added / updated as necessary to reflect
Copy link
Member

Choose a reason for hiding this comment

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

ditto, I think only IPv6 updates the annotation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

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 except two comments on the examples

listenPort: 179
advertisements:
service:
ipTypes: [ClusterIP, LoadBalancerIP]
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 should remove ClusterIP to make the example more reasonable. Normally there is no reason to advertise ClusterIP when the cluster has LoadBalancer enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

listenPort: 179
advertisements:
service:
ipTypes: [ClusterIP, ExternalIP, LoadBalancerIP]
Copy link
Member

Choose a reason for hiding this comment

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

ditto, we should at least remove ClusterIP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM

@antoninbas
Copy link
Contributor

/skip-all

@antoninbas antoninbas merged commit 0ca0a01 into antrea-io:main Jul 25, 2024
51 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transit/bgp Issues or PRs related to BGP support. kind/documentation Categorizes issue or PR as related to a documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants