documentation/deployment/kubernetes.md
You can deploy QuestDB in a Kubernetes cluster using a StatefulSet and a persistent volume. We distribute QuestDB via Helm on ArtifactHub.
Using the Helm client, add the official Helm chart repository:
helm repo add questdb https://helm.questdb.io/
Update the Helm index:
helm repo update
Start a local cluster using minikube:
minikube start
Then install the chart:
helm install my-questdb questdb/questdb
Finally, use the Kubernetes CLI to get the pod name:
kubectl get pods
Result:
| NAME | READY | STATUS | RESTARTS | AGE |
|---|---|---|---|---|
| my-questdb-0 | 1/1 | Running | 1 | 9m59s |
In order to run queries against your local instance of QuestDB, you can use port forwarding:
kubectl port-forward my-questdb-0 9000
The following ports may also be used:
The QuestDB Helm chart supports a variety of configuration options. Run the following to view all of them and any preconfigured defaults:
helm show values questdb/questdb
QuestDB supports reading sensitive configuration values directly from mounted
secret files using the _FILE suffix convention. This eliminates the need for
shell scripts or init containers to inject secrets as environment variables.
For example, to configure the PostgreSQL wire protocol password from a Kubernetes secret:
apiVersion: v1
kind: Secret
metadata:
name: questdb-secrets
type: Opaque
data:
pg-password: bXktc2VjcmV0LXBhc3N3b3Jk # base64 encoded
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: questdb
spec:
serviceName: questdb
replicas: 1
selector:
matchLabels:
app: questdb
template:
metadata:
labels:
app: questdb
spec:
containers:
- name: questdb
image: questdb/questdb:latest
env:
- name: QDB_PG_PASSWORD_FILE
value: /run/secrets/pg-password
volumeMounts:
- name: secrets
mountPath: /run/secrets
readOnly: true
volumes:
- name: secrets
secret:
secretName: questdb-secrets
items:
- key: pg-password
path: pg-password
:::note
This example focuses on secret mounting and omits the volumeClaimTemplates
needed for persistent storage. For production deployments, use the
QuestDB Helm chart which handles storage
configuration automatically.
:::
For the full list of supported properties, see Secrets from files in the configuration reference.