Skip to content

Commit 496194c

Browse files
Copy the docs from the superset-operator
1 parent 9c5759c commit 496194c

41 files changed

Lines changed: 1365 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/antora.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
name: home
3+
version: "nightly"
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#! /usr/bin/env bash
2+
set -euo pipefail
3+
4+
# DO NOT EDIT THE SCRIPT
5+
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
6+
7+
# TODO (@NickLarsenNZ): Use bitnami/postgres chart, and add version var to the above list
8+
# See similar changes in: https://github.com/stackabletech/hive-operator/pull/489/commits/8189f196f018c009370ae9b07a3f9609ee2e8681
9+
10+
# This script contains all the code snippets from the guide, as well as some assert tests
11+
# to test if the instructions in the guide work. The user *could* use it, but it is intended
12+
# for testing only.
13+
# The script will install the operators, create a superset instance and briefly open a port
14+
# forward and connect to the superset instance to make sure it is up and running.
15+
# No running processes are left behind (i.e. the port-forwarding is closed at the end)
16+
17+
if [ $# -eq 0 ]
18+
then
19+
echo "Installation method argument ('helm' or 'stackablectl') required."
20+
exit 1
21+
fi
22+
23+
cd "$(dirname "$0")"
24+
25+
case "$1" in
26+
"helm")
27+
echo "Installing Operators with Helm"
28+
# tag::helm-install-operators[]
29+
helm install --wait commons-operator oci://oci.stackable.tech/sdp-charts/commons-operator --version 0.0.0-dev
30+
helm install --wait secret-operator oci://oci.stackable.tech/sdp-charts/secret-operator --version 0.0.0-dev
31+
helm install --wait listener-operator oci://oci.stackable.tech/sdp-charts/listener-operator --version 0.0.0-dev
32+
helm install --wait superset-operator oci://oci.stackable.tech/sdp-charts/superset-operator --version 0.0.0-dev
33+
# end::helm-install-operators[]
34+
;;
35+
"stackablectl")
36+
echo "installing Operators with stackablectl"
37+
# tag::stackablectl-install-operators[]
38+
stackablectl operator install \
39+
commons=0.0.0-dev \
40+
secret=0.0.0-dev \
41+
listener=0.0.0-dev \
42+
superset=0.0.0-dev
43+
# end::stackablectl-install-operators[]
44+
;;
45+
*)
46+
echo "Need to give 'helm' or 'stackablectl' as an argument for which installation method to use!"
47+
exit 1
48+
;;
49+
esac
50+
51+
echo "Installing bitnami PostgreSQL"
52+
# tag::install-bitnami-psql[]
53+
helm install superset oci://registry-1.docker.io/bitnamicharts/postgresql \
54+
--version 16.5.0 \
55+
--set auth.username=superset \
56+
--set auth.password=superset \
57+
--set auth.database=superset \
58+
--wait
59+
# end::install-bitnami-psql[]
60+
61+
echo "Creating credentials secret"
62+
# tag::apply-superset-credentials[]
63+
kubectl apply -f superset-credentials.yaml
64+
# end::apply-superset-credentials[]
65+
66+
echo "Creating Superset cluster"
67+
# tag::apply-superset-cluster[]
68+
kubectl apply -f superset.yaml
69+
# end::apply-superset-cluster[]
70+
71+
sleep 5
72+
73+
for (( i=1; i<=15; i++ ))
74+
do
75+
echo "Waiting for SupersetCluster to appear ..."
76+
if eval kubectl get statefulset simple-superset-node-default; then
77+
break
78+
fi
79+
80+
sleep 1
81+
done
82+
83+
echo "Waiting on superset StatefulSet ..."
84+
# tag::wait-superset[]
85+
kubectl rollout status --watch statefulset/simple-superset-node-default --timeout 300s
86+
# end::wait-superset[]
87+
88+
# wait a bit for the port to open
89+
sleep 10
90+
91+
echo "Starting port-forwarding of port 8088"
92+
# tag::port-forwarding[]
93+
kubectl port-forward service/simple-superset-node 8088 > /dev/null 2>&1 &
94+
# end::port-forwarding[]
95+
PORT_FORWARD_PID=$!
96+
# shellcheck disable=2064 # we want the PID evaluated now, not at the time the trap is
97+
trap "kill $PORT_FORWARD_PID" EXIT
98+
sleep 5
99+
100+
echo "Checking if web interface is reachable ..."
101+
return_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8088/login/)
102+
if [ "$return_code" == 200 ]; then
103+
echo "Web interface reachable!"
104+
else
105+
echo "Could not reach web interface."
106+
exit 1
107+
fi
108+
109+
echo "Loading examples ..."
110+
# tag::load-examples[]
111+
kubectl apply -f superset-load-examples-job.yaml
112+
sleep 5
113+
kubectl wait --for=condition=complete --timeout=1500s job/superset-load-examples
114+
# end::load-examples[]
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#! /usr/bin/env bash
2+
set -euo pipefail
3+
4+
# DO NOT EDIT THE SCRIPT
5+
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
6+
7+
# TODO (@NickLarsenNZ): Use bitnami/postgres chart, and add version var to the above list
8+
# See similar changes in: https://github.com/stackabletech/hive-operator/pull/489/commits/8189f196f018c009370ae9b07a3f9609ee2e8681
9+
10+
# This script contains all the code snippets from the guide, as well as some assert tests
11+
# to test if the instructions in the guide work. The user *could* use it, but it is intended
12+
# for testing only.
13+
# The script will install the operators, create a superset instance and briefly open a port
14+
# forward and connect to the superset instance to make sure it is up and running.
15+
# No running processes are left behind (i.e. the port-forwarding is closed at the end)
16+
17+
if [ $# -eq 0 ]
18+
then
19+
echo "Installation method argument ('helm' or 'stackablectl') required."
20+
exit 1
21+
fi
22+
23+
cd "$(dirname "$0")"
24+
25+
case "$1" in
26+
"helm")
27+
echo "Installing Operators with Helm"
28+
# tag::helm-install-operators[]
29+
helm install --wait commons-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/commons-operator --version {{ versions.commons }}
30+
helm install --wait secret-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/secret-operator --version {{ versions.secret }}
31+
helm install --wait listener-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/listener-operator --version {{ versions.listener }}
32+
helm install --wait superset-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/superset-operator --version {{ versions.superset }}
33+
# end::helm-install-operators[]
34+
;;
35+
"stackablectl")
36+
echo "installing Operators with stackablectl"
37+
# tag::stackablectl-install-operators[]
38+
stackablectl operator install \
39+
commons={{ versions.commons }} \
40+
secret={{ versions.secret }} \
41+
listener={{ versions.listener }} \
42+
superset={{ versions.superset }}
43+
# end::stackablectl-install-operators[]
44+
;;
45+
*)
46+
echo "Need to give 'helm' or 'stackablectl' as an argument for which installation method to use!"
47+
exit 1
48+
;;
49+
esac
50+
51+
echo "Installing bitnami PostgreSQL"
52+
# tag::install-bitnami-psql[]
53+
helm install superset oci://registry-1.docker.io/bitnamicharts/postgresql \
54+
--version 16.5.0 \
55+
--set auth.username=superset \
56+
--set auth.password=superset \
57+
--set auth.database=superset \
58+
--wait
59+
# end::install-bitnami-psql[]
60+
61+
echo "Creating credentials secret"
62+
# tag::apply-superset-credentials[]
63+
kubectl apply -f superset-credentials.yaml
64+
# end::apply-superset-credentials[]
65+
66+
echo "Creating Superset cluster"
67+
# tag::apply-superset-cluster[]
68+
kubectl apply -f superset.yaml
69+
# end::apply-superset-cluster[]
70+
71+
sleep 5
72+
73+
for (( i=1; i<=15; i++ ))
74+
do
75+
echo "Waiting for SupersetCluster to appear ..."
76+
if eval kubectl get statefulset simple-superset-node-default; then
77+
break
78+
fi
79+
80+
sleep 1
81+
done
82+
83+
echo "Waiting on superset StatefulSet ..."
84+
# tag::wait-superset[]
85+
kubectl rollout status --watch statefulset/simple-superset-node-default --timeout 300s
86+
# end::wait-superset[]
87+
88+
# wait a bit for the port to open
89+
sleep 10
90+
91+
echo "Starting port-forwarding of port 8088"
92+
# tag::port-forwarding[]
93+
kubectl port-forward service/simple-superset-node 8088 > /dev/null 2>&1 &
94+
# end::port-forwarding[]
95+
PORT_FORWARD_PID=$!
96+
# shellcheck disable=2064 # we want the PID evaluated now, not at the time the trap is
97+
trap "kill $PORT_FORWARD_PID" EXIT
98+
sleep 5
99+
100+
echo "Checking if web interface is reachable ..."
101+
return_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8088/login/)
102+
if [ "$return_code" == 200 ]; then
103+
echo "Web interface reachable!"
104+
else
105+
echo "Could not reach web interface."
106+
exit 1
107+
fi
108+
109+
echo "Loading examples ..."
110+
# tag::load-examples[]
111+
kubectl apply -f superset-load-examples-job.yaml
112+
sleep 5
113+
kubectl wait --for=condition=complete --timeout=1500s job/superset-load-examples
114+
# end::load-examples[]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Installed commons=0.0.0-dev operator
2+
Installed secret=0.0.0-dev operator
3+
Installed listener=0.0.0-dev operator
4+
Installed superset=0.0.0-dev operator
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Installed commons={{ versions.commons }} operator
2+
Installed secret={{ versions.secret }} operator
3+
Installed listener={{ versions.listener }} operator
4+
Installed superset={{ versions.superset }} operator
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: simple-superset-credentials
6+
type: Opaque
7+
stringData:
8+
adminUser.username: admin
9+
adminUser.firstname: Superset
10+
adminUser.lastname: Admin
11+
adminUser.email: admin@superset.com
12+
adminUser.password: admin
13+
connections.secretKey: thisISaSECRET_1234
14+
connections.sqlalchemyDatabaseUri: postgresql://superset:superset@superset-postgresql.default.svc.cluster.local/superset
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: superset-load-examples
6+
spec:
7+
template:
8+
spec:
9+
volumes:
10+
- configMap:
11+
defaultMode: 420
12+
name: simple-superset-node-default
13+
name: config
14+
containers:
15+
- name: superset
16+
image: oci.stackable.tech/sdp/superset:4.1.2-stackable0.0.0-dev
17+
command: [
18+
"/bin/sh",
19+
"-c",
20+
"mkdir --parents /stackable/app/pythonpath && \
21+
cp /stackable/config/* /stackable/app/pythonpath && \
22+
echo 'SQLALCHEMY_EXAMPLES_URI = os.environ.get(\"SQLALCHEMY_DATABASE_URI\")' >> /stackable/app/pythonpath/superset_config.py && \
23+
superset load_examples"
24+
]
25+
env:
26+
- name: SECRET_KEY
27+
valueFrom:
28+
secretKeyRef:
29+
key: connections.secretKey
30+
name: simple-superset-credentials
31+
- name: SQLALCHEMY_DATABASE_URI
32+
valueFrom:
33+
secretKeyRef:
34+
key: connections.sqlalchemyDatabaseUri
35+
name: simple-superset-credentials
36+
volumeMounts:
37+
- mountPath: /stackable/config
38+
name: config
39+
resources:
40+
limits:
41+
cpu: 1200m
42+
memory: 1000Mi
43+
requests:
44+
cpu: 300m
45+
memory: 1000Mi
46+
restartPolicy: Never
47+
backoffLimit: 4
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: superset-load-examples
6+
spec:
7+
template:
8+
spec:
9+
volumes:
10+
- configMap:
11+
defaultMode: 420
12+
name: simple-superset-node-default
13+
name: config
14+
containers:
15+
- name: superset
16+
image: oci.stackable.tech/sdp/superset:4.1.2-stackable{{ versions.superset }}
17+
command: [
18+
"/bin/sh",
19+
"-c",
20+
"mkdir --parents /stackable/app/pythonpath && \
21+
cp /stackable/config/* /stackable/app/pythonpath && \
22+
echo 'SQLALCHEMY_EXAMPLES_URI = os.environ.get(\"SQLALCHEMY_DATABASE_URI\")' >> /stackable/app/pythonpath/superset_config.py && \
23+
superset load_examples"
24+
]
25+
env:
26+
- name: SECRET_KEY
27+
valueFrom:
28+
secretKeyRef:
29+
key: connections.secretKey
30+
name: simple-superset-credentials
31+
- name: SQLALCHEMY_DATABASE_URI
32+
valueFrom:
33+
secretKeyRef:
34+
key: connections.sqlalchemyDatabaseUri
35+
name: simple-superset-credentials
36+
volumeMounts:
37+
- mountPath: /stackable/config
38+
name: config
39+
resources:
40+
limits:
41+
cpu: 1200m
42+
memory: 1000Mi
43+
requests:
44+
cpu: 300m
45+
memory: 1000Mi
46+
restartPolicy: Never
47+
backoffLimit: 4
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
apiVersion: superset.stackable.tech/v1alpha1
3+
kind: SupersetCluster
4+
metadata:
5+
name: simple-superset
6+
spec:
7+
image:
8+
productVersion: 4.1.2
9+
clusterConfig:
10+
credentialsSecret: simple-superset-credentials
11+
nodes:
12+
roleConfig:
13+
listenerClass: external-unstable
14+
roleGroups:
15+
default:
16+
config:
17+
rowLimit: 10000
18+
webserverTimeout: 300
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /usr/bin/env bash
2+
set -euo pipefail
3+
4+
cd "$(dirname "$0")"
5+
./getting_started.sh helm

0 commit comments

Comments
 (0)