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
I haven't met this issue according to your guide, but in my ENV, The peer address shows the worker node 2019::101, not master 2019::100
ReplyDeletei'm not able to get bgpconfig, even bgp peer is already formed.
ReplyDeleteroot@master:/home/test# ./calicoctl get bgpconfig
NAME LOGSEVERITY MESHENABLED ASNUMBER
root@master:/home/test# ./calicoctl node status
Calico process is running.
IPv4 BGP status
+--------------+-------------------+-------+----------+---------+
| PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
+--------------+-------------------+-------+----------+---------+
| 10.0.2.17 | node-to-node mesh | start | 07:34:38 | Passive |
+--------------+-------------------+-------+----------+---------+
IPv6 BGP status
+--------------+-------------------+-------+----------+-------------+
| PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
+--------------+-------------------+-------+----------+-------------+
| 2019::101 | node-to-node mesh | up | 07:34:38 | Established |
+--------------+-------------------+-------+----------+-------------+