Operations
turbopuffer runs most operations on your cluster through the control plane. This page covers what you can watch and do yourself, from monitoring and scaling to managing organizations and API keys. To change settings, see Configuration.
Monitoring
The turbopuffer team monitors your cluster through the telemetry it sends to Datadog and Polar Signals, and is on-call for it. You don't need your own monitoring to keep the cluster healthy, but you can watch it yourself:
- Shared Datadog dashboard. turbopuffer shares a Datadog dashboard for your cluster with query latency, cache hit ratios, CPU, indexing queues, and pod counts. Ask us in your shared Slack channel for access. Sizing lists the widgets that tell you when to scale.
- Your own metrics. Set
stats_exportto also send turbopuffer's metrics to a statsd endpoint you run. - Your own traces. Set
tracing.otlp_endpointto send traces to an OTLP collector. - Kubernetes. turbopuffer runs in the
turbopuffernamespace, sokubectl get pods -n turbopuffer,kubectl logs, and your cloud provider's Kubernetes monitoring work as usual. - Control plane activity.
kubectl get turbopufferoperations -n turbopufferlists every operation turbopuffer has proposed or run on your cluster. See viewing and approving operations.
Scaling
Index nodes autoscale on their own. Query nodes don't, so you decide how many to
run. To change the number of query nodes, set min_query_nodes in
turbopuffer.tfvars, run terraform apply, and then run the
Helm upgrade. The
turbopuffer team can also scale query nodes for you through the control plane.
See Sizing for how to choose node counts and which dashboard widgets show it's time to scale.
Upgrades
If your cluster runs in manual approval mode, the turbopuffer team will provide you with a command to upgrade the cluster when a new version is available. Otherwise, upgrades will happen automatically through the control plane.
To limit upgrades to off-hours, set a maintenance window. If you deploy with ArgoCD or another GitOps tool, see deploying with GitOps tools.
Updating your kit
Terraform and scripts ship in the kit, while the Helm chart ships in the registry. Re-download the kit from the link turbopuffer provided to pick up Terraform changes, then run terraform apply again.
Control plane operations
turbopuffer BYOC includes our control plane agent which we can use to apply adjustments to your cluster.
Supported operations
The control plane agent is source-available upon request, and supports a limited amount of hardcoded operations to operate your cluster. The currently supported operations are listed below:
- Restart pods: Allows us to rapidly restart any pods we see behaving problematically via telemetry.
- Scale pods: Allows us to change the desired replica count for your index and query nodes.
- Trigger reindex: Allows us to force a reindex of a namespace.
- Trigger compaction: Triggers a compaction of the LSM for a given namespace, which can improve query performance.
- Trigger gc: Trigger a manual run of our garbage collector, which will reduce object storage usage.
- Warm cache: Pre-warms node caches to restore query performance, e.g. after a restart or scale-up.
- Get/set config: Allows us to read the live turbopuffer settings, and apply emergency setting overrides without a redeploy.
- Storage stats: Runs a storage amplification probe (physical vs. logical bytes).
- Tidy: Runs an internal maintenance job on your cluster.
- Upgrade tpuf: Updates the image digest for your turbopuffer deployment triggering a rollout for the new version of turbopuffer.
We typically find our BYOC customers operate best allowing us to perform routine maintenance operations (restarting pods, triggering indexing/compaction/gc). These operations may need to be performed unpredictably to react to shifting workloads or recent upgrades to your turbopuffer deployment.
Viewing and approving operations
If a modification proposed by turbopuffer requires approval, the agent will create an associated Kubernetes resource for this operation:
$ kubectl get turbopufferoperations -n turbopuffer --sort-by=.metadata.creationTimestamp
NAME APPROVED STATE AGE DETAILS
qjh4uts8557qxly3 true SUCCESS 7m58s Upgrade to 46bea73f769ed2e4...
jsilyy4wu8skamb9 true SUCCESS 7m57s Upgrade to c7ce48b6be870806...
kqc3ltskmsx32nr7 true SUCCESS 7m46s Upgrade to 60b44ccd78eaf20c...
pnblpzmh5gp5fwsy true SUCCESS 7m46s Upgrade to 32c171415362b200...
0a8n5w41jyj8i35v false REQUIRES_APPROVAL 7m46s Restart pods: turbopuffer-query-0*
You can approve an operation by editing the Kubernetes configuration. For example, approve 0a8n5w41jyj8i35v by running:
kubectl patch turbopufferoperation -n turbopuffer 0a8n5w41jyj8i35v --type=merge -p '{"spec": {"approved": true}}'
Custom Resource Definition transitions are generally logged by your cloud provider's Kubernetes cluster, so your standard audit logging tools should support turbopuffer's operations.
Organizations and API keys
turbopuffer BYOC allows you to configure multiple organizations, each with their own set of API keys which you can use to scope data access. API keys are admin keys by default, and you can limit a key with roles. Each API key applies to all namespaces in its organization. For this reason, if you need to ensure data is isolated we recommend creating multiple organizations instead. If this is a limitation, we recommend you contact us on Slack.
To also keep each organization's data in its own bucket, see bucket per customer.
Generating org IDs and API keys
You can generate valid org IDs and API keys using any tooling that produces cryptographically random values. The format requirements are:
Org ID
- 24 character random string
- Alphabet:
[a-z0-9](lowercase alphanumeric only)
API Key
- Prefix:
tpuf_ - Followed by: 32 character random string from alphabet
[a-zA-Z0-9] - Full format:
tpuf_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Stored API Key Hash
- Format:
base64(sha256(full_api_key)) - The hash is computed over the complete API key including the
tpuf_prefix
Warning: Never derive an API key or its hash from the org ID. The org ID is not a secret.
Your BYOC kit includes a generate-secrets.py script that generates these values for you.
Storing org configuration
Store each org ID with its API key hashes in
authentication.allowed_api_keys_sha256:
authentication:
allowed_api_keys_sha256:
"your24charorgidhere1234":
- "YourBase64EncodedSHA256HashHere+40CharactersTotal="
- "AnotherBase64EncodedSHA256HashHere+40CharactersTot="
Adding additional organizations
To add more organizations, generate new org ID and API key pairs and add them to the configuration:
authentication:
allowed_api_keys_sha256:
"existingorgid123456789012":
- "<base64(sha256(existing API key))>"
- "<base64(sha256(another existing API key))>"
"neworgid0987654321abcdef":
- "<base64(sha256(new org API key))>"
- "<base64(sha256(another new org API key))>"
Adding a new API key to an existing organization
Each organization can have multiple API keys for key rotation, different services, or other access patterns. To add a new API key, use the apikey.py script from your BYOC kit and append the generated hash to the organization's key list:
authentication:
allowed_api_keys_sha256:
"existingorgid123456789012":
- "<base64(sha256(existing API key))>"
- "<base64(sha256(newly added API key))>"
Adding a read-only API key
API keys are admin keys by default. To limit a key to reading and listing
namespaces, list it with roles instead of as a bare hash:
authentication:
allowed_api_keys_sha256:
"existingorgid123456789012":
- "<base64(sha256(existing API key))>"
- sha256: "<base64(sha256(read-only API key))>"
roles: ["read", "list"]
roles is a list of admin, write, read, and list.
After changing the org configuration, apply the configuration change.
Copying namespaces across clusters
You can use copy_from_namespace to copy
data between BYOC clusters. On the destination cluster:
- If the clusters use different org IDs, add an API key hash under the source's org ID in
authentication.allowed_api_keys_sha256. The org ID must match the data in the source bucket. You can register an existing source key or generate a new one. The destination cluster authenticates this key locally. - Define the source bucket under
blob.bucketsand map a source region name to it withblob.known_region_buckets. Match the source bucket'sprefix, if configured. Grant the destination cluster's cloud identity read access to the source bucket and any required encryption keys. - On the source bucket entry, set
enable_maintenance: falseto disable automatic maintenance, including garbage collection. Leave maintenance enabled on the source cluster. Setread_only: trueto prevent writes to the source bucket from the destination cluster.
Apply the changes using the Helm upgrade command, then
send a copy_from_namespace request to the
destination cluster. The destination namespace must not already exist:
curl "$DESTINATION_URL/v2/namespaces/destination-namespace" \
-H "Authorization: Bearer $DESTINATION_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"copy_from_namespace": {
"source_namespace": "source-namespace",
"source_region": "source-cluster",
"source_api_key": "<source API key registered on the destination cluster>"
}
}'
DESTINATION_API_KEY identifies the destination org. source_region must match a
key in blob.known_region_buckets and selects the source bucket for this copy.
source_api_key identifies the source org. Omit it when both clusters use the same
org ID. The region mapping does not change the bucket used for ordinary requests.
Do not configure a blob.bucket_overrides_by_org_id entry for the source org on
the destination cluster. Combining a source org override with source_region is
currently unsupported.
If the source namespace uses a customer-managed encryption key, specify destination
encryption in the copy request.