Install calico-plugin before running calico

This commit is contained in:
ant31 2015-12-28 22:02:30 +01:00
parent 5c15d14f12
commit e378f4fb14
4 changed files with 22 additions and 2 deletions

View file

@ -7,9 +7,10 @@ kubectl_checksum: "01b9bea18061a27b1cf30e34fd8ab45cfc096c9a9d57d0ed21072abb40dd3
kubelet_checksum: "62191c66f2d670dd52ddf1d88ef81048977abf1ffaa95ee6333299447eb6a482"
calico_version: v0.13.0
calico_plugin_version: v0.7.0
etcd_download_url: "https://github.com/coreos/etcd/releases/download"
flannel_download_url: "https://github.com/coreos/flannel/releases/download"
kube_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kube_version }}/bin/linux/amd64"
calico_download_url: "https://github.com/Metaswitch/calico-docker/releases/download"
calico_plugin_download_url: "https://github.com/projectcalico/calico-kubernetes/releases/download/{{calico_plugin_version}}/calico_kubernetes"

View file

@ -19,3 +19,9 @@
when: not c_tar.stat.exists
register: dl_calico
delegate_to: "{{ groups['kube-master'][0] }}"
- name: Download calico-kubernetes-plugin
local_action: get_url
url="{{calico_plugin_download_url}}"
dest="{{ local_release_dir }}/calico/bin/calico"

View file

@ -11,3 +11,16 @@
mode=0755
notify:
- restart kubelet
- name: Calico-plugin | Directory
file: path=/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/ state=directory
when: kube_network_plugin == "calico"
- name: Calico-plugin | Binary
copy:
src={{ local_release_dir }}/calico/bin/calico
dest=/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/calico
mode=0755
when: kube_network_plugin == "calico"
notify:
- restart kubelet

View file

@ -2,7 +2,7 @@
- name: "Test if network plugin is defined"
fail: msg="ERROR, One network_plugin variable must be defined (Flannel or Calico)"
when: ( kube_network_plugin is defined and kube_network_plugin == "calico" and kube_network_plugin == "flannel" ) or
kube_network_plugin is not defined
kube_network_plugin is not defined
- name: Write network-environment
template: src=network-environment.j2 dest=/etc/network-environment mode=640