Update to rook v1.1.0 (#169)

Update to rook v1.1.0 which has CSI support by default.

Closes #30

Signed-off-by: Justin Scott <justin.a.scott@intel.com>
This commit is contained in:
Justin Scott
2019-09-19 09:40:56 -07:00
committed by GitHub
parent dc48b000d5
commit bd6ac270e6
4 changed files with 43 additions and 13 deletions
@@ -0,0 +1,10 @@
resources:
- rook/cluster/examples/kubernetes/ceph/common.yaml
- rook/cluster/examples/kubernetes/ceph/operator.yaml
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
patchesStrategicMerge:
# patches rook to use 'directories' instead of partitions.
# comment out to use partitions
- patch_cephcluster.yaml
@@ -0,0 +1,9 @@
apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
name: rook-ceph
namespace: rook-ceph
spec:
storage:
directories:
- path: /var/lib/rook
+21 -13
View File
@@ -10,6 +10,8 @@ SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
: ${MASTER_IP:=}
HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
ROOK_VER="${CLRK8S_ROOK_VER:-v1.1.0}"
function print_usage_exit() {
exit_code=${1:-0}
cat <<EOT
@@ -109,7 +111,15 @@ function metrics() {
kubectl apply -k "${METRICS_DIR}/overlays/${METRICS_VER}"
}
function wait_on_pvc() {
# create and destroy pvc until successful
while [[ $(kubectl get pvc test-pv-claim --no-headers | grep Bound -c) -ne 1 ]]; do
sleep 30
kubectl delete pvc test-pv-claim
create_pvc
sleep 10
done
}
function create_pvc() {
kubectl apply -f - <<HERE
---
@@ -128,10 +138,12 @@ HERE
}
function storage() {
#Start rook before any other component that requires storage
ROOK_VER="${1:-v1.0.3}"
# start rook before any other component that requires storage
ROOK_VER="${1:-$ROOK_VER}"
ROOK_URL="https://github.com/rook/rook.git"
ROOK_DIR=7-rook
# get and apply rook
get_repo "${ROOK_URL}" "${ROOK_DIR}/overlays/${ROOK_VER}"
set_repo_version "${ROOK_VER}" "${ROOK_DIR}/overlays/${ROOK_VER}/rook"
kubectl apply -k "${ROOK_DIR}/overlays/${ROOK_VER}"
@@ -140,17 +152,13 @@ function storage() {
echo "Waiting for Rook OSD"
sleep 60
done
# set default storage class to rook-ceph-block
kubectl patch storageclass rook-ceph-block -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
create_pvc
# create and destroy pvc until successful
while [[ $(kubectl get pvc test-pv-claim --no-headers | grep Bound -c) -ne 1 ]]; do
sleep 30
kubectl delete pvc test-pv-claim
create_pvc
sleep 10
done
# set default storageclass
kubectl patch storageclass rook-ceph-block -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
create_pvc
# wait for pvc so subsequent pods have storage
wait_on_pvc
}
function monitoring() {
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
name=$( echo $(kubectl get po -o name -n rook-ceph | grep tools) | cut -c 5-)
kubectl exec -it "${name}" -n rook-ceph -- ceph status