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

This commit is contained in:
Erwan Miran 2018-10-16 08:44:49 +02:00 committed by k8s-ci-robot
parent 1ea7ec3189
commit 6549b8f8ae

View file

@ -159,6 +159,52 @@
- calico_version | version_compare('v3.0.0', '<') - calico_version | version_compare('v3.0.0', '<')
- nodeToMeshEnabled|default(True) - 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) - name: Calico | Configure peering with router(s)
shell: > shell: >
echo '{ echo '{