calico RR路由反射器

配置calicoctl

在官网下载calicoctl二进制文件,并给予可执行权限

curl -O -L  https://github.com/projectcalico/calicoctl/releases/download/v3.13.2/calicoctl

在master节点上配置

export DATASTORE_TYPE=kubernetes
export KUBECONFIG=~/.kube/config

测试

./calicoctl get nodes

部署路由反射器RR

[root@localhost ~]# yum install -y bird bird6

编辑bird配置文件

[root@localhost ~]# cat /etc/bird.conf|sed '/^#/d'|sed '/^$/d'
/*
 *	This is an example configuration file.
 */
router id 10.19.161.122;
protocol kernel {
	persist;		# Don't remove routes on bird shutdown
	scan time 20;		# Scan kernel routing table every 20 seconds
	export all;		# Default is export none
}
protocol device {
	scan time 10;		# Scan interfaces every 10 seconds
}
protocol static {
}
template bgp rr_client {
	local as 64512;
	multihop;
	rr client;
	graceful restart;
	import all;
	export all;
}
protocol bgp shen_mater150 from rr_client {
	description "10.19.161.150";
	neighbor 10.19.161.150 as 64512;
}
protocol bgp shen_mater151 from rr_client {
	description "10.19.161.151";
	neighbor 10.19.161.151 as 64512;
}
protocol bgp shen_mater152 from rr_client {
	description "10.19.161.152";
	neighbor 10.19.161.152 as 64512;
}
protocol bgp shen_master1 from rr_client {
	description "10.19.161.100";
	neighbor 10.19.161.100 as 64512;
}
protocol bgp shen_master2 from rr_client {
	description "10.19.161.101";
	neighbor 10.19.161.101 as 64512;
}
protocol bgp shen_master3 from rr_client {
	description "10.19.161.102";
	neighbor 10.19.161.102 as 64512;
}
protocol bgp shen_node141 from rr_client {
	description "10.19.164.141";
	neighbor 10.19.164.141 as 64512;
}

关闭原集群中bgp的NodeMesh模式

[root@shen-master150 calico]# cat stop.yaml 
apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
  name: default
spec:
  logSeverityScreen: Info
  nodeToNodeMeshEnabled: false
  asNumber: 64512
[root@shen-master150 calico]# calicoctl create -f stop.yaml 
[root@shen-master150 calico]# calicoctl get bgpconfig
NAME      LOGSEVERITY   MESHENABLED   ASNUMBER   
default   Info          false         64512 

给calico集群指定一个全局的bpg邻居,即路由反射器

[root@shen-master150 calico]# cat stop.yaml 
apiVersion: projectcalico.org/v3
kind: BGPConfiguration
metadata:
  name: default
spec:
  logSeverityScreen: Info
  nodeToNodeMeshEnabled: false
  asNumber: 64512
[root@shen-master150 calico]# calicoctl create -f stop.yaml ^C
[root@shen-master150 calico]# cat bgp.yaml 
apiVersion: projectcalico.org/v3
kind: BGPPeer
metadata:
  name: bgppeer-global
spec:
  peerIP: 10.19.161.122
  asNumber: 64512
[root@shen-master150 calico]# calicoctl create -f bgp.yaml 

查看状态

[root@shen-master150 calico]# calicoctl node status
Calico process is running.

IPv4 BGP status
+---------------+-----------+-------+----------+-------------+
| PEER ADDRESS  | PEER TYPE | STATE |  SINCE   |    INFO     |
+---------------+-----------+-------+----------+-------------+
| 10.19.161.122 | global    | up    | 03:02:36 | Established |
+---------------+-----------+-------+----------+-------------+

IPv6 BGP status
No IPv6 peers found.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值