新增BGP配置

  1. 编辑新增BGP配置的yaml文件。

    如下所示配置一个新的BGP,注意BGP名称和ASNumber不能与已有的BGP冲突。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    apiVersion: projectcalico.org/v3
    kind: BGPConfiguration
    metadata:
    name: default
    spec:
    logSeverityScreen: Info
    nodeToNodeMeshEnabled: true
    asNumber: 63400
    serviceClusterIPs:
    - cidr: 10.244.0.0/16
    

    参数配置详见官方介绍BGP配置

  2. 添加BGP。

    1
    calicoctl apply -f - < bgp.yaml
    

    命令返回如下信息,表示添加成功。

    1
    Successfully applied 1 BGPConfiguration resource(s)
    

  3. 执行如下命令获取刚添加的BGP配置信息,并以宽格式输出。

    calicoctl get bgpConfiguration -o wide
    1
    2
    NAME     LOGSEVERITY     MESHENAbLED     ASNUMBER
    default  Info            true            63400