aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/kubernetes/roles/kargo
diff options
context:
space:
mode:
authorDi Xu <di.xu@arm.com>2018-01-04 18:21:20 +0800
committerDi Xu <di.xu@arm.com>2018-02-13 16:34:50 +0800
commit098208121bba3ef6d576976c2e975c56f89ae901 (patch)
treed89ab21e9b44cd9c9fadb64649cd7f9c114d125b /deploy/adapters/ansible/kubernetes/roles/kargo
parent5dd3af7fd00971a96d91397f9754e6455abb660d (diff)
add a multus with 2 fannel interfaces installation
Support deploying multus multiple flannel CNI plugins by setting environment "kube_network_plugin" to "2flannel". Change-Id: I23a3d42452b4a5e0858a18934f508649f5961e7a Signed-off-by: Di Xu <di.xu@arm.com>
Diffstat (limited to 'deploy/adapters/ansible/kubernetes/roles/kargo')
-rw-r--r--deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml45
1 files changed, 44 insertions, 1 deletions
diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
index f68eec43..187e2a52 100644
--- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
+++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
@@ -57,7 +57,6 @@
- netaddr
- jinja2
-
- name: copy inventories generate script
copy:
src: generate_inventories.py
@@ -156,6 +155,50 @@
- extra-vars-{{ ansible_architecture }}.yml
- extra-vars.yml
+- name: copy 2flannel playbook to kargo
+ copy:
+ src: "{{ run_dir }}/roles/2flannel"
+ dest: /opt/kargo_k8s/roles/network_plugin
+
+- name: copy 2flannel-apps playbook to kargo
+ copy:
+ src: "{{ run_dir }}/roles/2flannel-apps/"
+ dest: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/2flannel
+
+- name: append 2flannel to network plugin
+ blockinfile:
+ path: /opt/kargo_k8s/roles/network_plugin/meta/main.yml
+ block: " - role: network_plugin/2flannel\n \
+ when: kube_network_plugin == '2flannel'\n tags: 2flannel\n"
+
+- name: append 2flannel apps to network plugin
+ blockinfile:
+ path: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/meta/main.yml
+ block: " - role: kubernetes-apps/network_plugin/2flannel\n \
+ when: kube_network_plugin == '2flannel'\n tags: 2flannel\n"
+
+- name: append 2flannel to valid kube_network_plugin list
+ replace:
+ path: "/opt/kargo_k8s/roles/kubernetes/{{ item.path }}"
+ regexp: "{{ item.regexp }}"
+ replace: "{{ item.replace }}"
+ with_items:
+ - {path: 'master/templates/manifests/kube-controller-manager.manifest.j2',
+ regexp: '"cloud", "flannel"',
+ replace: '"cloud", "flannel", "2flannel"'}
+ - {path: 'node/templates/kubelet.kubeadm.env.j2',
+ regexp: '"calico", "canal", "flannel", "weave"',
+ replace: '"calico", "canal", "flannel", "weave", "2flannel"'}
+ - {path: 'node/templates/kubelet.standard.env.j2',
+ regexp: '"calico", "canal", "flannel", "weave"',
+ replace: '"calico", "canal", "flannel", "weave", "2flannel"'}
+ - {path: 'node/templates/kubelet.rkt.service.j2',
+ regexp: '"calico", "weave", "canal", "flannel"',
+ replace: '"calico", "weave", "canal", "flannel", "2flannel"'}
+ - {path: 'preinstall/tasks/main.yml',
+ regexp: '"calico", "weave", "canal", "flannel"',
+ replace: '"calico", "weave", "canal", "flannel", "2flannel"'}
+
- name: run kargo playbook
shell: |
cd /opt/kargo_k8s