Enable CSI plugin for Stor4nfv scenario 27/52627/9
authorYifei Xue <xueyifei@huawei.com>
Mon, 26 Feb 2018 09:15:45 +0000 (17:15 +0800)
committerYifei Xue <xueyifei@huawei.com>
Tue, 27 Feb 2018 10:48:41 +0000 (18:48 +0800)
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 <xueyifei@huawei.com>
deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml

index 187e2a5..6d94762 100644 (file)
        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