From 739cf5995361e69ab1ce378cf1d5ceaf8691d0cc Mon Sep 17 00:00:00 2001 From: Anthony Haussmann Date: Tue, 13 Sep 2016 14:58:29 +0200 Subject: [PATCH 1/2] Determine hyperkube cni to use Starting from version 1.3.4 of hyperkube, calico is "canalized" which requires flannel and hostonly cni plugins.So we let hyperkube ship necessary cni --- roles/network_plugin/calico/tasks/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roles/network_plugin/calico/tasks/main.yml b/roles/network_plugin/calico/tasks/main.yml index abe0f690d..75cf2d4a2 100644 --- a/roles/network_plugin/calico/tasks/main.yml +++ b/roles/network_plugin/calico/tasks/main.yml @@ -22,6 +22,17 @@ changed_when: false notify: restart calico-node +- name: Calico | Determine hyperkube cni to use depending of the version of kube + set_fact: + use_hyperkube_cni: > + {%- if kube_version | version_compare('v1.3.4','>=') -%} + true + {%- elif kube_version | version_compare('v1.3.4','<') -%} + false + {%- else -%} + {{ ErrorCannotRecognizeVersion }} + {%- endif -%} + - name: Calico | Install calico cni bin command: rsync -piu "{{ local_release_dir }}/calico/bin/calico" "/opt/cni/bin/calico" changed_when: false From d47a2d03b46d2b1dcd771385bbccc16f6c894ab1 Mon Sep 17 00:00:00 2001 From: Anthony Haussmann Date: Tue, 13 Sep 2016 14:59:50 +0200 Subject: [PATCH 2/2] Delete default variable use_hyperkube_cni The variable is now set via a task depending of the version of kube --- roles/network_plugin/calico/defaults/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/roles/network_plugin/calico/defaults/main.yml b/roles/network_plugin/calico/defaults/main.yml index 0f59b21d5..3cdf5b492 100644 --- a/roles/network_plugin/calico/defaults/main.yml +++ b/roles/network_plugin/calico/defaults/main.yml @@ -13,8 +13,3 @@ calicoctl_image_tag: "{{ calico_version }}" calico_node_image_repo: calico/node calico_node_image_tag: "{{ calico_version }}" - -# Set to true if your Hyperkube has all required components to run -# calico. This is required in order to run canalized calico. -use_hyperkube_cni: false -