mirror of
https://github.com/clearlinux/cloud-native-setup.git
synced 2026-09-03 20:31:30 +00:00
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:
@@ -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
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user