Skip to content

Commit

Permalink
add bgp v6 and debug (#215)
Browse files Browse the repository at this point in the history
* add bgp v6 and debug

Signed-off-by: bobz965 <[email protected]>

* fix lint

Signed-off-by: bobz965 <[email protected]>

---------

Signed-off-by: bobz965 <[email protected]>
  • Loading branch information
bobz965 authored Oct 15, 2024
1 parent 515f60f commit 5922428
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 8 deletions.
31 changes: 28 additions & 3 deletions docs/advance/with-bgp.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,23 @@ wget https://raw.githubusercontent.com/kubeovn/kube-ovn/{{ variables.branch }}/y

Modify the corresponding configuration in yaml:

If you only have one switch:

```yaml
--neighbor-address=10.32.32.1
--neighbor-as=65030
--cluster-as=65000
- --neighbor-address=10.32.32.254
- --neighbor-ipv6-address=2409:AB00:AB00:2000::AFB:8AFE
- --neighbor-as=65030
- --cluster-as=65000
```
If you have a pair of switches:
```yaml

- --neighbor-address=10.32.32.252,10.32.32.253
- --neighbor-ipv6-address=2409:AB00:AB00:2000::AFB:8AFC,2409:AB00:AB00:2000::AFB:8AFD
- --neighbor-as=65030
- --cluster-as=65000
```
- `neighbor-address`: The address of the BGP Peer, usually the router gateway address.
Expand Down Expand Up @@ -267,3 +280,15 @@ is handled by a daemon such as `kube-proxy`. The annotation for Services only su
- `graceful-restart-deferral-time`: BGP Graceful restart deferral time refer to RFC4724 4.1.
- `passivemode`: The Speaker runs in Passive mode and does not actively connect to the peer.
- `ebgp-multihop`: The TTL value of EBGP Peer, default is 1.

## BGP routes debug

```bash
# show peer neighbor
gobgp neighbor
# show announced routes to one peer
gobgp neighbor 10.32.32.254 adj-out
```
35 changes: 30 additions & 5 deletions docs/advance/with-bgp.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Kube-OVN 支持将 Pods、Subnets、Services 和 EIPs 的 IP 地址通过 BGP 协议向外部进行路由广播,从而使得外部可以直接访问到集群内的 IP 地址。
如果需要使用该功能,需要在特定节点安装 `kube-ovn-speaker` 并对需要对外暴露的 Pod 或 Subnet 增加对应的 annotation。

如果要在 EIP 上使用 BGP,需要使用特殊参数创建 VPC NAT Gateway,有关更多信息,请参阅[发布 EIPs](#eips)
如果要在 EIP 上使用 BGP,需要使用特殊参数创建 VPC NAT Gateway,有关更多信息,请参阅[发布 EIPs](#发布-eips)

## 安装 kube-ovn-speaker

Expand All @@ -26,10 +26,23 @@ wget https://raw.githubusercontent.com/kubeovn/kube-ovn/{{ variables.branch }}/y

修改 yaml 内相应配置:

如果你只有一个交换机:

```yaml
--neighbor-address=10.32.32.1
--neighbor-as=65030
--cluster-as=65000
- --neighbor-address=10.32.32.254
- --neighbor-ipv6-address=2409:AB00:AB00:2000::AFB:8AFE
- --neighbor-as=65030
- --cluster-as=65000
```
如果你有一对交换机:
```yaml

- --neighbor-address=10.32.32.252,10.32.32.253
- --neighbor-ipv6-address=2409:AB00:AB00:2000::AFB:8AFC,2409:AB00:AB00:2000::AFB:8AFD
- --neighbor-as=65030
- --cluster-as=65000
```
- `neighbor-address`: BGP Peer 的地址,通常为路由器网关地址。
Expand Down Expand Up @@ -60,7 +73,7 @@ kubectl annotate pod sample ovn.kubernetes.io/bgp-
kubectl annotate subnet ovn-default ovn.kubernetes.io/bgp-
```

查看[发布策略](#_1)以了解如何通过设置注解来控制 BGP 对外发布策略。
查看[发布策略](#发布策略)以了解如何通过设置注解来控制 BGP 对外发布策略。

## 发布 `ClusterIP` 类型 Service 路由

Expand Down Expand Up @@ -197,3 +210,15 @@ kubectl annotate eip sample ovn.kubernetes.io/bgp=true
- `graceful-restart-deferral-time`: BGP Graceful restart deferral time 可参考 RFC4724 4.1。
- `passivemode`: Speaker 运行在 passive 模式,不主动连接 peer。
- `ebgp-multihop`: ebgp ttl 默认值为 1。

## BGP routes debug

```bash
# show peer neighbor
gobgp neighbor
# show announced routes to one peer
gobgp neighbor 10.32.32.254 adj-out
```

0 comments on commit 5922428

Please sign in to comment.