Browse Source

Ability to define the asNumber on a per node basis when route reflectors are not used in order to peer directly with routers (#3492)

pull/3493/head
Erwan Miran 6 years ago
committed by k8s-ci-robot
parent
commit
6549b8f8ae
1 changed files with 46 additions and 0 deletions
  1. 46
      roles/network_plugin/calico/tasks/install.yml

46
roles/network_plugin/calico/tasks/install.yml

@ -159,6 +159,52 @@
- calico_version | version_compare('v3.0.0', '<')
- nodeToMeshEnabled|default(True)
- name: Calico | Configure node asNumber for per node peering
shell: >
echo '{
"apiVersion": "projectcalico.org/v3",
"kind": "Node",
"metadata": {
"name": "{{ inventory_hostname }}"
},
"spec": {
"bgp": {
"asNumber": "{{ local_as }}"
},
"orchRefs":[{"nodeName":"{{ inventory_hostname }}","orchestrator":"k8s"}]
}}' | {{ bin_dir }}/calicoctl create --skip-exists -f -
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
when:
- calico_version | version_compare('v3.0.0', '>=')
- peer_with_router|default(false)
- inventory_hostname in groups['k8s-cluster']
- local_as is defined
- groups['calico-rr'] | default([]) | length == 0
- name: Calico | Configure node asNumber for per node peering (legacy)
shell: >
echo '{
"apiVersion": "v1",
"kind": "node",
"metadata": {
"name": "{{ inventory_hostname }}"
},
"spec": {
"bgp": {
"asNumber": "{{ local_as }}"
},
"orchRefs":[{"nodeName":"{{ inventory_hostname }}","orchestrator":"k8s"}]
}}' | {{ bin_dir }}/calicoctl create --skip-exists -f -
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
when:
- calico_version | version_compare('v3.0.0', '<')
- peer_with_router|default(false)
- inventory_hostname in groups['k8s-cluster']
- local_as is defined
- groups['calico-rr'] | default([]) | length == 0
- name: Calico | Configure peering with router(s)
shell: >
echo '{

Loading…
Cancel
Save