diff --git a/inventory/sample/group_vars/k8s_cluster/k8s-net-kube-router.yml b/inventory/sample/group_vars/k8s_cluster/k8s-net-kube-router.yml index 383280187..e96963345 100644 --- a/inventory/sample/group_vars/k8s_cluster/k8s-net-kube-router.yml +++ b/inventory/sample/group_vars/k8s_cluster/k8s-net-kube-router.yml @@ -26,6 +26,9 @@ # https://github.com/cloudnativelabs/kube-router/blob/master/docs/user-guide.md # kube_router_extra_args: [] +# ASN number of the cluster, used when communicating with external BGP routers +# kube_router_cluster_asn: ~ + # ASN numbers of the BGP peer to which cluster nodes will advertise cluster ip and node's pod cidr. # kube_router_peer_router_asns: ~ diff --git a/roles/network_plugin/kube-router/defaults/main.yml b/roles/network_plugin/kube-router/defaults/main.yml index 441d80842..886377b31 100644 --- a/roles/network_plugin/kube-router/defaults/main.yml +++ b/roles/network_plugin/kube-router/defaults/main.yml @@ -25,6 +25,9 @@ kube_router_enable_dsr: false # https://github.com/cloudnativelabs/kube-router/blob/master/docs/user-guide.md kube_router_extra_args: [] +# ASN number of the cluster, used when communicating with external BGP routers +kube_router_cluster_asn: ~ + # ASN numbers of the BGP peer to which cluster nodes will advertise cluster ip and node's pod cidr. kube_router_peer_router_asns: ~ diff --git a/roles/network_plugin/kube-router/templates/kube-router.yml.j2 b/roles/network_plugin/kube-router/templates/kube-router.yml.j2 index e24715d1c..ab677abc8 100644 --- a/roles/network_plugin/kube-router/templates/kube-router.yml.j2 +++ b/roles/network_plugin/kube-router/templates/kube-router.yml.j2 @@ -49,6 +49,9 @@ spec: {% if kube_router_advertise_loadbalancer_ip %} - --advertise-loadbalancer-ip {% endif %} +{% if kube_router_cluster_asn %} + - --cluster-asn={{ kube_router_cluster_asn }} +{% endif %} {% if kube_router_peer_router_asns %} - --peer-router-asns={{ kube_router_peer_router_asns }} {% endif %}