mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-04-14 06:29:32 -02:30
Fix possible problems with legacy calicoctl
When running legacy calicoctl we do not specify calico hostname in calico-node container thus we should not specify it in CNI config. Also move 'legacy_calicoctl' set_fact task to the top.
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
- name: Calico | Check calicoctl version
|
||||||
|
run_once: true
|
||||||
|
set_fact:
|
||||||
|
legacy_calicoctl: "{{ calicoctl_image_tag | version_compare('v1.0.0', '<') }}"
|
||||||
|
|
||||||
- name: Calico | Write Calico cni config
|
- name: Calico | Write Calico cni config
|
||||||
template:
|
template:
|
||||||
src: "cni-calico.conf.j2"
|
src: "cni-calico.conf.j2"
|
||||||
@@ -70,11 +75,6 @@
|
|||||||
delegate_to: "{{groups['etcd'][0]}}"
|
delegate_to: "{{groups['etcd'][0]}}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
- name: Calico | Check calicoctl version
|
|
||||||
run_once: true
|
|
||||||
set_fact:
|
|
||||||
legacy_calicoctl: "{{ calicoctl_image_tag | version_compare('v1.0.0', '<') }}"
|
|
||||||
|
|
||||||
- name: Calico | Configure calico network pool
|
- name: Calico | Configure calico network pool
|
||||||
shell: >
|
shell: >
|
||||||
echo '{
|
echo '{
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "calico-k8s-network",
|
"name": "calico-k8s-network",
|
||||||
|
{% if not legacy_calicoctl %}
|
||||||
"hostname": "{{ inventory_hostname }}",
|
"hostname": "{{ inventory_hostname }}",
|
||||||
|
{% endif %}
|
||||||
"type": "calico",
|
"type": "calico",
|
||||||
"etcd_endpoints": "{{ etcd_access_endpoint }}",
|
"etcd_endpoints": "{{ etcd_access_endpoint }}",
|
||||||
"etcd_cert_file": "{{ etcd_cert_dir }}/node.pem",
|
"etcd_cert_file": "{{ etcd_cert_dir }}/node.pem",
|
||||||
|
|||||||
Reference in New Issue
Block a user