This will show how to remove default BGP Peers and add node specific peers
Prerequisite: install-calicoctl-in-kubernetes-cluster.html
1. Disable full node to mesh peering.
cat << EOF | calicoctl create -f -
apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
name: default
spec:
logSeverityScreen: Info
nodeToNodeMeshEnabled: false
asNumber: 64512
EOF
2. Add Node specific BGP Peer
cat << EOF | calicoctl create -f -
cat << EOF | calicoctl create -f -
apiVersion: projectcalico.org/v3
kind: BGPPeer
metadata:
name: bgppeer-node-master1
spec:
peerIP: 2019::100
node: worker1
asNumber: 64512
EOF
root@worker1:~# calicoctl node status
Calico process is running.
IPv4 BGP status
+--------------+---------------+-------+----------+-------------+
| PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
+--------------+---------------+-------+----------+-------------+
| 172.16.0.6 | node specific | up | 12:30:30 | Established |
+--------------+---------------+-------+----------+-------------+
IPv6 BGP status
+--------------+---------------+-------+----------+-------------+
| PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
+--------------+---------------+-------+----------+-------------+
| 2019::100 | node specific | up | 12:30:08 | Established |
+--------------+---------------+-------+----------+-------------+
References
https://docs.projectcalico.org/v3.5/usage/configuration/bgp
https://docs.projectcalico.org/v3.5/reference/calicoctl/resources/bgpconfig
Prerequisite: install-calicoctl-in-kubernetes-cluster.html
1. Disable full node to mesh peering.
cat << EOF | calicoctl create -f -
apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
name: default
spec:
logSeverityScreen: Info
nodeToNodeMeshEnabled: false
asNumber: 64512
EOF
2. Add Node specific BGP Peer
- master1 to worker1
cat << EOF | calicoctl create -f -
apiVersion: projectcalico.org/v3
kind: BGPPeer
metadata:
name: bgppeer-node-worker1
spec:
peerIP: 2019::101
node: master1
asNumber: 64512
EOF
kind: BGPPeer
metadata:
name: bgppeer-node-worker1
spec:
peerIP: 2019::101
node: master1
asNumber: 64512
EOF
- worker1 to master1
cat << EOF | calicoctl create -f -
apiVersion: projectcalico.org/v3
kind: BGPPeer
metadata:
name: bgppeer-node-master1
spec:
peerIP: 2019::100
node: worker1
asNumber: 64512
EOF
Calico process is running.
IPv4 BGP status
+--------------+---------------+-------+----------+-------------+
| PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
+--------------+---------------+-------+----------+-------------+
| 172.16.0.6 | node specific | up | 12:30:30 | Established |
+--------------+---------------+-------+----------+-------------+
IPv6 BGP status
+--------------+---------------+-------+----------+-------------+
| PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
+--------------+---------------+-------+----------+-------------+
| 2019::100 | node specific | up | 12:30:08 | Established |
+--------------+---------------+-------+----------+-------------+
References
https://docs.projectcalico.org/v3.5/usage/configuration/bgp
https://docs.projectcalico.org/v3.5/reference/calicoctl/resources/bgpconfig