From f7711167f1f8df28f82068274cbb43f74ea30bcf Mon Sep 17 00:00:00 2001 From: Yifei Xue Date: Mon, 26 Feb 2018 17:15:45 +0800 Subject: Enable CSI plugin for Stor4nfv scenario JIRA: - Add some configurations to enable CSI plugin in k8s v1.9 which is used by Stor4nfv scenario. Change-Id: I78e0b39f31ff666eace50921c691107154dcb249 Signed-off-by: Yifei Xue --- .../ansible/kubernetes/roles/kargo/tasks/main.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'deploy/adapters/ansible/kubernetes/roles/kargo/tasks') diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml index 187e2a52..6d947623 100644 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml @@ -199,6 +199,24 @@ regexp: '"calico", "weave", "canal", "flannel"', replace: '"calico", "weave", "canal", "flannel", "2flannel"'} +# yamllint disable rule:line-length +- name: enable CSI plugin feature + lineinfile: + dest: "/opt/kargo_k8s/roles/kubespray-defaults/defaults/main.yaml" + regexp: "^kube_feature_gates:" + line: "{% raw %}kube_feature_gates: ['Initializers={{ istio_enabled|string }}', 'PersistentLocalVolumes={{ local_volumes_enabled|string }}', 'CSIPersistentVolume=True', 'MountPropagation=True']{% endraw %}" + when: + - stor4nfv is defined and stor4nfv == "Enable" +# yamllint enable rule:line-length + +- name: enable CSI plugin runtime_config + lineinfile: + dest: /opt/kargo_k8s/roles/kubernetes/master/defaults/main.yml + insertafter: '^ - admissionregistration.k8s.io/v1alpha1' + line: ' - storage.k8s.io/v1alpha1' + when: + - stor4nfv is defined and stor4nfv == "Enable" + - name: run kargo playbook shell: | cd /opt/kargo_k8s -- cgit 1.2.3-korg