-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path40-modify-superset.sh
executable file
·45 lines (34 loc) · 1.14 KB
/
40-modify-superset.sh
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
#!/usr/bin/env bash
set -euo pipefail
shopt -s lastpipe
# Touch the file and trap the delete command for later
touch superset.yaml
trap 'rm superset.yaml' EXIT
echo "Fetching SupersetCluster definition from k8s"
# tag::get-superset-yaml[]
kubectl get superset superset -o yaml > superset.yaml
# end::get-superset-yaml[]
echo "Deleting SupersetCluster"
# tag::delete-superset[]
kubectl delete superset superset
# end::delete-superset[]
echo "Waiting for deletion to complete ..."
kubectl wait --for=delete statefulset/superset-node-default --timeout=60s
sleep 2
echo "Updating superset.yaml in-place with authentication LDAP snippet"
yq -i '. *= load("superset-auth-snippet.yaml")' superset.yaml
echo "Applying updated configuration"
# tag::apply-superset-cluster[]
kubectl apply -f superset.yaml
# end::apply-superset-cluster[]
for (( i=1; i<=15; i++ ))
do
echo "Waiting for superset StatefulSet to appear ..."
if eval kubectl get statefulset superset-node-default; then
break
fi
sleep 1
done
echo "Waiting for superset StatefulSet ..."
kubectl rollout status --watch statefulset/superset-node-default
sleep 2 # just to be sure we're up and running