forked from kubealex/libvirt-k8s-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path32_install_rook.yml
70 lines (59 loc) · 2.59 KB
/
32_install_rook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
- name: Prepare cluster to install rook
hosts: masters
run_once: true
vars_files:
- vars/k8s_cluster.yml
tasks:
- block:
- name: Clone rook repository
git:
repo: "{{ rook.rook_repo }}"
dest: /tmp/rook
version: "{{ rook.rook_version }}"
force: true
- name: Create CRDs for rook-ceph
shell: "kubectl create -f /tmp/rook/cluster/examples/kubernetes/ceph/crds.yaml"
ignore_errors: true
- name: Create common resources for rook-ceph
shell: "kubectl create -f /tmp/rook/cluster/examples/kubernetes/ceph/common.yaml"
ignore_errors: true
- name: Create rook-ceph-operator resource
shell: "kubectl create -f /tmp/rook/cluster/examples/kubernetes/ceph/operator.yaml"
ignore_errors: true
- name: Wait for all rook-ceph-operator pods to be created
shell: "kubectl get po --namespace=rook-ceph --output=jsonpath='{.items[*].metadata.name}'"
register: rook_ceph_operator_pods_created
until: item in rook_ceph_operator_pods_created.stdout
retries: 20
delay: 30
with_items:
- rook-ceph-operator
- name: Wait for operator pod to be ready
shell: "kubectl wait --namespace=rook-ceph --for=condition=Ready pods -l 'app in (rook-ceph-operator)' --timeout=600s"
- name: Create cluster resources for rook_ceph
shell: "kubectl create -f /tmp/rook/cluster/examples/kubernetes/ceph/cluster.yaml"
ignore_errors: true
- name: Wait for cluster pod creation
shell: sleep 60s
- name: Wait for all rook-ceph pods to be created
shell: "kubectl get po --namespace=rook-ceph --output=jsonpath='{.items[*].metadata.name}'"
register: rook_ceph_pods_created
until: item in rook_ceph_pods_created.stdout
retries: 20
delay: 30
with_items:
- csi-cephfsplugin
- csi-cephfsplugin-provisioner
- csi-rbdplugin
- csi-rbdplugin-provisioner
- rook-ceph-crashcollector
- rook-ceph-mgr
- rook-ceph-mon
- rook-ceph-osd
- name: Create cluster resources for rook_ceph
shell: sleep 60s
- name: Wait for cluster pods to be ready (May take a while..)
shell: "kubectl wait --namespace=rook-ceph --for=condition=Ready pods -l 'app in (csi-cephfsplugin,csi-cephfsplugin-provisioner,csi-rbdplugin,csi-rbdplugin-provisioner,rook-ceph-crashcollector,rook-ceph-mgr,rook-ceph-mon,rook-ceph-osd)' --timeout=600s"
register: rook_cluster_pod_ready
when: rook_ceph.install_rook