Kube-OVN supports advertise pod/subnet ips to external networks by BGP protocol. To enable BGP advertise function, you need to install kube-ovn-speaker and annotate pods/subnets that need to be exposed.
- Label nodes that host the BGP speaker and act as overlay to underlay gateway
kubectl label nodes speaker-node-1 ovn.kubernetes.io/bgp=true
kubectl label nodes speaker-node-2 ovn.kubernetes.io/bgp=true
- Download
kube-ovn-speaker
yaml
wget https://github.com/kubeovn/kube-ovn/blob/master/yamls/speaker.yaml
- Modify the args in yaml
--neighbor-address=10.32.32.1 # The router address that need to establish bgp peers
--neighbor-as=65030 # The AS of router
--cluster-as=65000 # The AS of container network
- Apply the yaml
kubectl apply -f speaker.yaml
NOTE: When more than one node host speaker, the upstream router need to support multiple path routes to act ECMP.
The subnet of pods and subnets need to be advertised should set natOutgoing
to false
# Enable BGP advertise
kubectl annotate pod sample ovn.kubernetes.io/bgp=true
kubectl annotate subnet ovn-default ovn.kubernetes.io/bgp=true
# Disable BGP advertise
kubectl annotate pod perf-ovn-xzvd4 ovn.kubernetes.io/bgp-
kubectl annotate subnet ovn-default ovn.kubernetes.io/bgp-