-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy path99-one-step-install-longhorn.sh
More file actions
executable file
·38 lines (32 loc) · 1.09 KB
/
99-one-step-install-longhorn.sh
File metadata and controls
executable file
·38 lines (32 loc) · 1.09 KB
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
#! /bin/bash -e
# Check if devsecops.cfg file exists
if [ ! -f $HOME/.kube/devsecops.cfg ]; then
echo "Please copy the kubeconfig file of Rancher devsecops cluster into $HOME/kube/devsecops.cfg file before running this script."
exit
fi
export KUBECONFIG=$HOME/.kube/devsecops.cfg
helm repo add longhorn https://charts.longhorn.io
helm repo update
helm upgrade --install longhorn longhorn/longhorn \
--set persistence.defaultClassReplicaCount=1 \
--set persistence.reclaimPolicy=Delete \
--version=1.4.1 \
--namespace longhorn-system \
--create-namespace
echo "Your Longhorn is provisioning...."
while [ `kubectl -n longhorn-system get deploy | grep longhorn- | grep 1/1 | wc -l` -ne 2 ]
do
sleep 10
echo "Wait while longhorn is still provisioning..."
kubectl get deploy -n longhorn-system
done
echo "Your Longhorn CSI is provisioning...."
while [ `kubectl -n longhorn-system get deploy | grep csi- | grep 3/3 | wc -l` -ne 4 ]
do
sleep 10
echo "Wait while longhorn CSI is still provisioning..."
kubectl get deploy -n longhorn-system
done
echo
echo "Your longhorn is ready..."
echo