Skip to content

Commit

Permalink
docs: Fix getting started guide to use postgres and TLS
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Dec 13, 2024
1 parent da92475 commit 3c72ffd
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
23 changes: 16 additions & 7 deletions docs/modules/druid/examples/getting_started/druid.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ spec:
image:
productVersion: 30.0.0
clusterConfig:
listenerClass: external-stable # This exposes your Stacklet outside of Kubernetes. Remove this configuration if this is not desired
zookeeperConfigMapName: simple-druid-znode
deepStorage:
hdfs:
configMapName: simple-hdfs
directory: /data
directory: /druid
metadataStorageDatabase:
dbType: derby
connString: jdbc:derby://localhost:1527/var/druid/metadata.db;create=true
host: localhost
port: 1527
tls: null
zookeeperConfigMapName: simple-druid-znode
dbType: postgresql
connString: jdbc:postgresql://postgresql-druid/druid
host: postgresql-druid
port: 5432
credentialsSecret: druid-db-credentials
brokers:
roleGroups:
default:
Expand All @@ -38,3 +39,11 @@ spec:
roleGroups:
default:
replicas: 1
---
apiVersion: v1
kind: Secret
metadata:
name: druid-db-credentials
stringData:
username: druid
password: druid
11 changes: 11 additions & 0 deletions docs/modules/druid/examples/getting_started/getting_started.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ kubectl rollout status --watch statefulset/simple-hdfs-journalnode-default --tim
kubectl rollout status --watch statefulset/simple-hdfs-namenode-default --timeout=300s
# end::watch-hdfs-rollout[]

echo "Installing PostgreSQL for Druid"
# tag::helm-install-postgres[]
helm install postgresql-druid \
--repo https://charts.bitnami.com/bitnami postgresql \
--version 16.1.2 \
--set auth.database=druid \
--set auth.username=druid \
--set auth.password=druid \
--wait
# end::helm-install-postgres[]

echo "Install DruidCluster from druid.yaml"
# tag::install-druid[]
kubectl apply --server-side -f druid.yaml
Expand Down
4 changes: 4 additions & 0 deletions docs/modules/druid/examples/getting_started/hdfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ spec:
dfsReplication: 1
zookeeperConfigMapName: simple-hdfs-znode
nameNodes:
config:
listenerClass: external-stable # This exposes your Stacklet outside of Kubernetes. Remove this configuration if this is not desired
roleGroups:
default:
replicas: 2
dataNodes:
config:
listenerClass: external-unstable # This exposes your Stacklet outside of Kubernetes. Remove this configuration if this is not desired
roleGroups:
default:
replicas: 1
Expand Down
16 changes: 15 additions & 1 deletion docs/modules/druid/pages/getting_started/first_steps.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Three things need to be installed to have a Druid cluster:

* A ZooKeeper instance for internal use by Druid
* An HDFS instance to be used as a backend for deep storage
* A PostgreSQL database to store the metadata of Druid
* The Druid cluster itself

Create them in this order, each one is created by applying a manifest file.
Expand Down Expand Up @@ -47,6 +48,17 @@ And apply it:
include::example$getting_started/getting_started.sh[tag=install-hdfs]
----


=== PostgreSQL

Install a PostgreSQL database using `helm`.
If you already have a PostgreSQL instance, you can skip this step and use your own below.

[source,bash]
----
include::example$getting_started/getting_started.sh[tag=helm-install-postgres]
----

=== Druid

Create a file named `druid.yaml` with the following contents:
Expand Down Expand Up @@ -94,7 +106,9 @@ simple-hdfs-namenode-default 2/2 6m
simple-zk-server-default 3/3 7m
----

Then, create a port-forward for the Druid Router:
Ideally you use `stackablectl stacklet list` to find out the address the Druid router is reachable at and use that address.

As an alternative, you can create a port-forward for the Druid Router:

----
include::example$getting_started/getting_started.sh[tag=port-forwarding]
Expand Down

0 comments on commit 3c72ffd

Please sign in to comment.