-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetting_started.sh
More file actions
executable file
·128 lines (110 loc) · 4.59 KB
/
getting_started.sh
File metadata and controls
executable file
·128 lines (110 loc) · 4.59 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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/env bash
set -euo pipefail
# DO NOT EDIT THE SCRIPT
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
# The getting started guide script
# It uses tagged regions which are included in the documentation
# https://docs.asciidoctor.org/asciidoc/latest/directives/include-tagged-regions/
#
# There are two variants to go through the guide - using stackablectl or helm
# The script takes either 'stackablectl' or 'helm' as an argument
#
# The script can be run as a test as well, to make sure that the tutorial works
# It includes some assertions throughout, and at the end especially.
if [ $# -eq 0 ]
then
echo "Installation method argument ('helm' or 'stackablectl') required."
exit 1
fi
echo "Waiting for node(s) to be ready..."
kubectl wait node --all --for=condition=Ready --timeout=120s
cd "$(dirname "$0")"
case "$1" in
"helm")
echo "Installing Operators with Helm"
# tag::helm-install-operators[]
helm install --wait commons-operator oci://oci.stackable.tech/sdp-charts/commons-operator --version 0.0.0-dev
helm install --wait secret-operator oci://oci.stackable.tech/sdp-charts/secret-operator --version 0.0.0-dev
helm install --wait listener-operator oci://oci.stackable.tech/sdp-charts/listener-operator --version 0.0.0-dev
helm install --wait hive-operator oci://oci.stackable.tech/sdp-charts/hive-operator --version 0.0.0-dev
# end::helm-install-operators[]
echo "Install minio for S3"
# tag::helm-install-minio[]
helm install minio \
--version 5.4.0 \
--namespace default \
--set mode=standalone \
--set replicas=1 \
--set persistence.enabled=false \
--set "buckets[0].name=hive,buckets[0].policy=none" \
--set "users[0].accessKey=hive,users[0].secretKey=hivehive,users[0].policy=readwrite" \
--set resources.requests.memory=1Gi \
--set service.type=NodePort,service.nodePort=null \
--set consoleService.type=NodePort,consoleService.nodePort=null \
--repo https://charts.min.io/ minio
# end::helm-install-minio[]
echo "Install postgres for Hive"
# tag::helm-install-postgres[]
helm install postgresql oci://registry-1.docker.io/bitnamicharts/postgresql \
--version 16.5.0 \
--namespace default \
--set image.repository=bitnamilegacy/postgresql \
--set volumePermissions.image.repository=bitnamilegacy/os-shell \
--set metrics.image.repository=bitnamilegacy/postgres-exporter \
--set global.security.allowInsecureImages=true \
--set auth.username=hive \
--set auth.password=hive \
--set auth.database=hive \
--set primary.extendedConfiguration="password_encryption=md5" \
--wait
# end::helm-install-postgres[]
;;
"stackablectl")
# This step will be omitted since the operators are installed via the stack definition
# It is just kept for documentation purposes here
if false; then
echo "Installing Operators with stackablectl"
# tag::stackablectl-install-operators[]
stackablectl operator install \
commons=0.0.0-dev \
secret=0.0.0-dev \
listener=0.0.0-dev \
hive=0.0.0-dev
# end::stackablectl-install-operators[]
fi
echo "Installing MinIO and PostgreSQL with stackablectl"
# tag::stackablectl-install-minio-postgres-stack[]
stackablectl \
--stack-file stackablectl-hive-postgres-minio-stack.yaml \
--release-file release.yaml \
stack install hive-minio-postgres
# end::stackablectl-install-minio-postgres-stack[]
;;
*)
echo "Need to provide 'helm' or 'stackablectl' as an argument for which installation method to use!"
exit 1
;;
esac
# TODO: Remove once https://github.com/stackabletech/issues/issues/828 has been implemented (see that issue for details).
until kubectl get crd hiveclusters.hive.stackable.tech >/dev/null 2>&1; do echo "Waiting for CRDs to be installed" && sleep 1; done
echo "Install HiveCluster"
# tag::install-hive[]
kubectl apply -f hive-minio-credentials.yaml
kubectl apply -f hive-minio-credentials-secret-class.yaml
kubectl apply -f hive-minio-s3-connection.yaml
kubectl apply -f hive-postgres-s3.yaml
# end::install-hive[]
sleep 15
echo "Awaiting Hive rollout finish"
# tag::watch-hive-rollout[]
kubectl rollout status --watch --timeout=8m statefulset/hive-postgres-s3-metastore-default
# end::watch-hive-rollout[]
echo "Install Hive test helper from hive-test-helper.yaml"
kubectl apply -f hive-test-helper.yaml
sleep 15
echo "Awaiting Hive test helper rollout finish"
kubectl rollout status --watch --timeout=5m statefulset/hive-test-helper
# Only for testing the cluster (not required for documentation)
echo "Running test scripts"
kubectl cp -n default ../../../../../tests/templates/kuttl/smoke/test_metastore.py hive-test-helper-0:/tmp
kubectl exec -n default hive-test-helper-0 -- python /tmp/test_metastore.py -m hive-postgres-s3-metastore