|
| 1 | +function apply_communities () |
| 2 | +{ |
| 3 | +} |
| 4 | + |
| 5 | +# Generated by confd |
| 6 | +include "bird_aggr.cfg"; |
| 7 | +include "bird_ipam.cfg"; |
| 8 | + |
| 9 | +router id 10.192.0.2; |
| 10 | + |
| 11 | +# Configure synchronization between routing tables and kernel. |
| 12 | +protocol kernel { |
| 13 | + learn; # Learn all alien routes from the kernel |
| 14 | + persist; # Don't remove routes on bird shutdown |
| 15 | + scan time 2; # Scan kernel routing table every 2 seconds |
| 16 | + import all; |
| 17 | + export filter calico_kernel_programming; # Default is export none |
| 18 | + graceful restart; # Turn on graceful restart to reduce potential flaps in |
| 19 | + # routes when reloading BIRD configuration. With a full |
| 20 | + # automatic mesh, there is no way to prevent BGP from |
| 21 | + # flapping since multiple nodes update their BGP |
| 22 | + # configuration at the same time, GR is not guaranteed to |
| 23 | + # work correctly in this scenario. |
| 24 | + merge paths on; # Allow export multipath routes (ECMP) |
| 25 | +} |
| 26 | + |
| 27 | +# Watch interface up/down events. |
| 28 | +protocol device { |
| 29 | + debug { states }; |
| 30 | + scan time 2; # Scan interfaces every 2 seconds |
| 31 | +} |
| 32 | + |
| 33 | +protocol direct { |
| 34 | + debug { states }; |
| 35 | + interface -"cali*", -"kube-ipvs*", "*"; # Exclude cali* and kube-ipvs* but |
| 36 | + # include everything else. In |
| 37 | + # IPVS-mode, kube-proxy creates a |
| 38 | + # kube-ipvs0 interface. We exclude |
| 39 | + # kube-ipvs0 because this interface |
| 40 | + # gets an address for every in use |
| 41 | + # cluster IP. We use static routes |
| 42 | + # for when we legitimately want to |
| 43 | + # export cluster IPs. |
| 44 | +} |
| 45 | + |
| 46 | + |
| 47 | +# Template for all BGP clients |
| 48 | +template bgp bgp_template { |
| 49 | + debug { states }; |
| 50 | + description "Connection to BGP peer"; |
| 51 | + local as 64512; |
| 52 | + multihop; |
| 53 | + gateway recursive; # This should be the default, but just in case. |
| 54 | + import all; # Import all routes, since we don't know what the upstream |
| 55 | + # topology is and therefore have to trust the ToR/RR. |
| 56 | + export filter calico_export_to_bgp_peers; # Only want to export routes for workloads. |
| 57 | + add paths on; |
| 58 | + graceful restart; # See comment in kernel section about graceful restart. |
| 59 | + connect delay time 2; |
| 60 | + connect retry time 5; |
| 61 | + error wait time 5,30; |
| 62 | +} |
| 63 | + |
| 64 | +# ------------- Node-to-node mesh ------------- |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +# For peer /host/kube-master/ip_addr_v4 |
| 71 | +# Skipping ourselves (10.192.0.2) |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +# For peer /host/kube-node-1/ip_addr_v4 |
| 76 | +protocol bgp Mesh_10_192_0_3 from bgp_template { |
| 77 | + neighbor 10.192.0.3 as 64512; |
| 78 | + source address 10.192.0.2; # The local address we use for the TCP connection |
| 79 | + passive on; # Mesh is unidirectional, peer will connect to us. |
| 80 | +} |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +# For peer /host/kube-node-2/ip_addr_v4 |
| 85 | +protocol bgp Mesh_10_192_0_4 from bgp_template { |
| 86 | + neighbor 10.192.0.4 as 64512; |
| 87 | + source address 10.192.0.2; # The local address we use for the TCP connection |
| 88 | + passive on; # Mesh is unidirectional, peer will connect to us. |
| 89 | +} |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +# ------------- Global peers ------------- |
| 94 | +# No global peers configured. |
| 95 | + |
| 96 | + |
| 97 | +# ------------- Node-specific peers ------------- |
| 98 | + |
| 99 | +# No node-specific peers configured. |
| 100 | + |
0 commit comments