Skip to content

Commit

Permalink
[local mode] Add examples about how to deploy HerdDB in minikube (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
eolivelli authored Sep 27, 2023
1 parent 4b4dc01 commit 147f35e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dev/start-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ fi
# Start MinIO (S3 blobstorage)
kubectl apply -f helm/examples/minio-dev.yaml

# Start HerdDB (Simple Vector Database)
kubectl apply -f helm/examples/herddb-dev.yaml

# Start LangStream
helm repo add langstream https://langstream.github.io/charts
helm repo update
Expand Down
4 changes: 3 additions & 1 deletion examples/applications/docker-chatbot/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ configuration:
configuration:
service: "jdbc"
driverClass: "herddb.jdbc.Driver"
url: "jdbc:herddb:server:localhost:7000"
url: "{{secrets.herddb.url}}"
user: "{{secrets.herddb.user}}"
password: "{{secrets.herddb.password}}"
- type: "open-ai-configuration"
name: "OpenAI Azure configuration"
configuration:
Expand Down
5 changes: 5 additions & 0 deletions examples/secrets/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ secrets:
secure-connect-bundle: "${CASSANDRA_SECURE_BUNDLE:-}"
contact-points: "${CASSANDRA_CONTACT_POINTS:-}"
load-balancing-loadDc: "${CASSANDRA_LOAD_BALANCING_LOCALDC:-}"
- id: herddb
data:
url: ${HERDDB_URL:jdbc:herddb:server:herddb.herddb-dev:7000}
user: ${HERDDB_USER:-herd}
password: ${HERDDB_PASSWORD:hda}
- id: s3
data:
bucket-name: "${S3_BUCKET_NAME:-documents}"
Expand Down
38 changes: 38 additions & 0 deletions helm/examples/herddb-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: v1
kind: Namespace
metadata:
name: herddb-dev
labels:
name: herddb-dev
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: herddb
name: herddb
namespace: herddb-dev
spec:
containers:
- name: herddb
image: herddb/herddb:0.28.0
ports:
- containerPort: 7000
protocol: TCP
name: herddb
---
apiVersion: v1
kind: Service
metadata:
labels:
app: herddb
name: herddb
namespace: herddb-dev # Change this value to match the namespace metadata.name
spec:
ports:
- port: 7000
protocol: TCP
targetPort: 7000
name: herddb
selector:
app: herddb
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,15 @@ private void executeOnDocker(
commandLine.add("-v");
commandLine.add(tmpSecretsFile.getAbsolutePath() + ":/code/secrets.yaml");
}

// with this tricks K8S examples work on Docker seamlessly
commandLine.add("--add-host");
commandLine.add("minio.minio-dev.svc.cluster.local:127.0.0.1");
commandLine.add("--add-host");
commandLine.add("herddb.herddb-dev.svc.cluster.local:127.0.0.1");
commandLine.add("--add-host");
commandLine.add("my-cluster-kafka-bootstrap.kafka:127.0.0.1");

// gateway
commandLine.add("-p");
commandLine.add("8091:8091");
Expand Down

0 comments on commit 147f35e

Please sign in to comment.