docs/deploy/self-hosted/kubernetes.mdx
Kubernetes is the recommended way to run ParadeDB in production. Both ParadeDB Community and Enterprise binaries can be deployed on Kubernetes.
<Note> We recommend running ParadeDB Enterprise, not Community, with Kubernetes in production to maximize uptime. See [overview](/deploy/overview#self-hosted). </Note>This guide uses the ParadeDB Helm Chart. The chart is also available on Artifact Hub.
This guide assumes you have installed Helm and have a Kubernetes cluster running v1.25+. For local testing, we recommend Minikube.
The ParadeDB Helm chart supports monitoring via Prometheus and Grafana. To enable this, you need to have the Prometheus CRDs installed before installing the CloudNativePG operator. If you do not yet have the Prometheus CRDs installed on your Kubernetes cluster, you can install it with:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm upgrade --atomic --install prometheus-community \
--create-namespace \
--namespace prometheus-community \
--values https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/docs/src/samples/monitoring/kube-stack-config.yaml \
prometheus-community/kube-prometheus-stack
Skip this step if the CloudNativePG operator is already installed in your cluster. If you do not wish to monitor your cluster, omit the --set commands.
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm upgrade --atomic --install cnpg \
--create-namespace \
--namespace cnpg-system \
--set monitoring.podMonitorEnabled=true \
--set monitoring.grafanaDashboard.create=true \
cnpg/cloudnative-pg
Create a values.yaml and configure it to your requirements. Here is a basic example:
type: paradedb
mode: standalone
cluster:
instances: 1
storage:
size: 256Mi
type: paradedb-enterprise
mode: standalone
cluster:
instances: 1
storage:
size: 256Mi
Next, create a namespace for this step or use an existing namespace. The namespace can be any value.
kubectl create namespace <your-namespace>
For ParadeDB Enterprise, you should have received an enterprise Docker username and personal access token. The following step passes these credentials to Kubernetes and should be skipped if you are deploying ParadeDB Community.
kubectl create secret docker-registry paradedb-enterprise-registry-cred
--namespace <your-namespace>
--docker-server="https://index.docker.io/v1/"
--docker-username="<enterprise_docker_username>"
--docker-password="<enterprise_docker_access_token>"
Finally, launch the ParadeDB cluster.
helm repo add paradedb https://paradedb.github.io/charts
helm upgrade --atomic --install paradedb \
--namespace <your-namespace> \
--values values.yaml \
--set cluster.monitoring.enabled=true \
paradedb/paradedb
The command to connect to the primary instance of the cluster will be printed in your terminal. If you do not modify any settings, it will be:
kubectl --namespace paradedb exec --stdin --tty services/paradedb-rw -- bash
This will launch a Bash shell inside the instance. You can connect to the ParadeDB database via psql with:
psql -d paradedb
To connect to the Grafana dashboard for your cluster, we suggested port forwarding the Kubernetes service running Grafana to localhost:
kubectl --namespace prometheus-community port-forward svc/prometheus-community-grafana 3000:80
You can then access the Grafana dasbhoard at localhost:3000 using the credentialsadminas username andprom-operator as password. These default credentials are defined in the [kube-stack-config.yaml](https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/docs/src/samples/monitoring/kube-stack-config.yaml) file used as the values.yamlfile in [Installing the Prometheus CRDs](#installing-the-prometheus-stack) and can be modified by providing your ownvalues.yaml` file. A more detailed guide on monitoring the cluster can be found in the CloudNativePG documentation.