Update rook-ceph kubernetes deployment for k8s 1.15
[infra/stack/kubernetes.git] / apps / ceph / kubespray / playbooks / roles / install / tasks / main.yaml
index 4c4ebe9b93dc053f1397ff3776d355b7ef92aba8..044007cb19c9254a00a022d7f409fee680e961e2 100644 (file)
@@ -37,7 +37,7 @@
 
 - name: Delete existing rook cluster CRD if any
   k8s:
-    api_version: apiextensions.k8s.io/v1beta1
+    api_version: apiextensions.k8s.io/v1
     state: absent
     kind: CustomResourceDefinition
     name: cephclusters.ceph.rook.io
@@ -51,6 +51,7 @@
   with_items:
     - operator.yaml.j2
     - common.yaml.j2
+    - crds.yaml.j2
   loop_control:
     loop_var: config_file
   ignore_errors: true
   delay: 5
   tags: reset
 
+- name: label storage nodes  # noqa 305
+  shell: "kubectl label node {{ item }} {{ rook_storage_label }}=true"
+  changed_when: true
+  with_items: "{{ rook_storage_nodes }}"
+
+- name: taint storage nodes  # noqa 305
+  shell: "kubectl taint node {{ item }} {{ rook_storage_label }}=true:NoSchedule"
+  changed_when: true
+  with_items: "{{ rook_storage_nodes }}"
+
+- name: label nodes for other workloads  # noqa 305
+  shell: "kubectl label node {{ item }} {{ rook_storage_label }}=false"
+  changed_when: true
+  with_items: "{{ rook_nostorage_nodes }}"
+
 - name: Create rook operator
   k8s:
     state: present
     definition: "{{ lookup('template', config_file) }}"
   with_items:
+    - crds.yaml.j2
     - common.yaml.j2
     - operator.yaml.j2
   loop_control: