Skip to main content
By default, SambaNova provisions a PostgreSQL instance within your cluster. To use an external PostgreSQL database instead of the in-cluster deployment, complete the following steps:

Step 1: Create the Secret

Option A: Base64-encoded Values

First, encode your database credentials:
echo -n "<db-host>" | base64
echo -n "<db-name>" | base64
echo -n "<db-user>" | base64
echo -n "<db-password>" | base64
Create a Kubernetes secret with base64-encoded values:
apiVersion: v1
kind: Secret
metadata:
  name: pg-credentials
  namespace: sambastack
type: Opaque
data:
  DB_HOST: <Base64 encoded DB_HOST>
  DB_DATABASE: <Base64 encoded DB_DATABASE>
  DB_USER: <Base64 encoded DB_USER>
  DB_PASSWD: <Base64 encoded DB_PASSWD>
Apply the secret:
kubectl apply -f pg-credentials.yaml

Option B: Using kubectl with Literal Values

Instead of manually encoding, you can create the secret with literal values:
kubectl create secret generic pg-credentials \
  --from-literal=DB_HOST=<host> \
  --from-literal=DB_DATABASE=<database> \
  --from-literal=DB_USER=<user> \
  --from-literal=DB_PASSWD=<password> \
  --namespace sambastack

Step 2: Update sambastack.yaml

Configure your sambastack.yaml to use the external database:
auth-and-billing:
  pgSecretName: pg-credentials

cloudnative-pg:
  enabled: false
  • auth-and-billing.pgSecretName: References the Kubernetes secret containing database credentials
  • cloudnative-pg.enabled: false: Disables the in-cluster PostgreSQL deployment
See the SambaStack.yaml Reference for a full example.

Step 3: Apply the Configuration

Update your Helm deployment:
helm upgrade sambastack \
  -f sambastack.yaml \
  --namespace sambastack \
  oci://<REGISTRY_URL>/sambastack/sambastack
SambaNova provides the full registry URL and version number during handover. Contact your SambaNova representative for access credentials.
Ensure your external PostgreSQL database is accessible from the Kubernetes cluster and that network policies allow the connection.