Put back legacy support for calico ippools and bgp settings
This commit is contained in:
parent
18f0531bba
commit
d91f9e14e6
2 changed files with 46 additions and 10 deletions
|
@ -22,6 +22,7 @@
|
||||||
that:
|
that:
|
||||||
- calico_version_on_server.stdout|version_compare('v2.6.5', '>=')
|
- calico_version_on_server.stdout|version_compare('v2.6.5', '>=')
|
||||||
msg: "Your version of calico is not fresh enough for upgrade"
|
msg: "Your version of calico is not fresh enough for upgrade"
|
||||||
|
when: calico_upgrade_enabled
|
||||||
|
|
||||||
- name: "Set upgrade flag when version needs to be updated"
|
- name: "Set upgrade flag when version needs to be updated"
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Calico | Write Calico cni config
|
- name: Calico | Write Calico cni config
|
||||||
template:
|
template:
|
||||||
src: "cni-calico.conflist.j2"
|
src: "cni-calico.conflist.j2"
|
||||||
|
@ -102,6 +101,25 @@
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||||
when:
|
when:
|
||||||
|
- calico_version_on_server.stdout|version_compare('v3.0.0', '>') or calico_upgrade_enabled
|
||||||
|
- 'calico_conf.stdout == "0"'
|
||||||
|
|
||||||
|
- name: Calico | Configure calico network pool (legacy)
|
||||||
|
shell: >
|
||||||
|
echo '
|
||||||
|
{ "kind": "ipPool",
|
||||||
|
"spec": {"disabled": false, "ipip": {"enabled": {{ ipip }}, "mode": "{{ ipip_mode|lower }}"},
|
||||||
|
"nat-outgoing": {{ nat_outgoing|default(false) and not peer_with_router|default(false) }}},
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"metadata": {"cidr": "{{ kube_pods_subnet }}"}
|
||||||
|
}' | {{ bin_dir }}/calicoctl apply -f -
|
||||||
|
environment:
|
||||||
|
NO_DEFAULT_POOLS: true
|
||||||
|
run_once: true
|
||||||
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||||
|
when:
|
||||||
|
- calico_version_on_server.stdout|version_compare('v3.0.0', '<')
|
||||||
|
- not calico_upgrade_enabled
|
||||||
- 'calico_conf.stdout == "0"'
|
- 'calico_conf.stdout == "0"'
|
||||||
|
|
||||||
- name: "Determine nodeToNodeMesh needed state"
|
- name: "Determine nodeToNodeMesh needed state"
|
||||||
|
@ -112,7 +130,6 @@
|
||||||
- inventory_hostname in groups['k8s-cluster']
|
- inventory_hostname in groups['k8s-cluster']
|
||||||
run_once: yes
|
run_once: yes
|
||||||
|
|
||||||
|
|
||||||
- name: Calico | Set global as_num
|
- name: Calico | Set global as_num
|
||||||
shell: >
|
shell: >
|
||||||
echo '
|
echo '
|
||||||
|
@ -127,6 +144,24 @@
|
||||||
"asNumber": {{ global_as_num }} }} ' | {{ bin_dir }}/calicoctl --skip-exists create -f -
|
"asNumber": {{ global_as_num }} }} ' | {{ bin_dir }}/calicoctl --skip-exists create -f -
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||||
|
when:
|
||||||
|
- calico_version_on_server.stdout|version_compare('v3.0.0', '>') or calico_upgrade_enabled
|
||||||
|
|
||||||
|
- name: Calico | Set global as_num (legacy)
|
||||||
|
command: "{{ bin_dir}}/calicoctl config set asNumber {{ global_as_num }}"
|
||||||
|
run_once: true
|
||||||
|
when:
|
||||||
|
- calico_version_on_server.stdout|version_compare('v3.0.0', '<')
|
||||||
|
- not calico_upgrade_enabled
|
||||||
|
|
||||||
|
- name: Calico | Disable node mesh (legacy)
|
||||||
|
command: "{{ bin_dir }}/calicoctl config set nodeToNodeMesh off"
|
||||||
|
run_once: yes
|
||||||
|
when:
|
||||||
|
- calico_version_on_server.stdout|version_compare('v3.0.0', '<')
|
||||||
|
- not calico_upgrade_enabled
|
||||||
|
- nodeToMeshEnabled|default(True)
|
||||||
|
run_once: true
|
||||||
|
|
||||||
- name: Calico | Configure peering with router(s)
|
- name: Calico | Configure peering with router(s)
|
||||||
shell: >
|
shell: >
|
||||||
|
@ -164,10 +199,10 @@
|
||||||
delay: "{{ retry_stagger | random + 3 }}"
|
delay: "{{ retry_stagger | random + 3 }}"
|
||||||
with_items: "{{ peers|default([]) }}"
|
with_items: "{{ peers|default([]) }}"
|
||||||
when:
|
when:
|
||||||
- calico_version_on_server.stdout|version_compare('v3.0.0', '<')
|
- calico_version_on_server.stdout|version_compare('v3.0.0', '<')
|
||||||
- not calico_upgrade_enabled
|
- not calico_upgrade_enabled
|
||||||
- peer_with_router|default(false)
|
- peer_with_router|default(false)
|
||||||
- inventory_hostname in groups['k8s-cluster']
|
- inventory_hostname in groups['k8s-cluster']
|
||||||
|
|
||||||
- name: Calico | Configure peering with route reflectors
|
- name: Calico | Configure peering with route reflectors
|
||||||
shell: >
|
shell: >
|
||||||
|
@ -208,10 +243,10 @@
|
||||||
delay: "{{ retry_stagger | random + 3 }}"
|
delay: "{{ retry_stagger | random + 3 }}"
|
||||||
with_items: "{{ groups['calico-rr'] | default([]) }}"
|
with_items: "{{ groups['calico-rr'] | default([]) }}"
|
||||||
when:
|
when:
|
||||||
- calico_version_on_server.stdout|version_compare('v3.0.0', '<')
|
- calico_version_on_server.stdout|version_compare('v3.0.0', '<')
|
||||||
- not calico_upgrade_enabled
|
- not calico_upgrade_enabled
|
||||||
- peer_with_calico_rr|default(false)
|
- peer_with_calico_rr|default(false)
|
||||||
- hostvars[item]['cluster_id'] == cluster_id
|
- hostvars[item]['cluster_id'] == cluster_id
|
||||||
|
|
||||||
|
|
||||||
- name: Calico | Create calico manifests
|
- name: Calico | Create calico manifests
|
||||||
|
|
Loading…
Reference in a new issue