Skip to main content
A deployment is described by one body: you create a deployment with it, read the deployment back in the same shape, and change it with it. The body carries schemaVersion: 1, so the schema can evolve without new routes: the endpoints stay /api/clusters and /api/clusters/{name}. The Admin UI and every example on this page use it.

The body

A read adds status: state and ready, node and sentinel counts, endpoints, the TLS certificate’s expiry, pendingChanges (accepted but not applied yet), lastFailedOperation, and unmanagedFields (settings made outside this API, such as with the YAML editor). lastFailedOperation is the latest operation that ended Failed, Cancelled or Aborted, with its type, name, phase, the spec path it would have changed, KubeBlocks’ message and the time it ended. It stays until a later operation on the same part of the spec (or, for a restart or switchover, of the same type) replaces it, so a client polling pendingChanges can tell a change that failed from one that finished. A read leaves out what is not kept on the deployment itself: config.enterprise and config.server (they live in redis.conf) and backup. An inline security.auth.password reads back as the passwordSecretRef of the Secret it was moved into.

Create, read and change

  • GET /api/clusters?schemaVersion=1 lists deployments as { "schemaVersion": 1, "deployments": [...], "total": N }.
  • PATCH takes a JSON Merge Patch: send only what changes. Objects merge, lists are replaced whole, and null removes a field.
  • PUT takes a whole body. Fields it leaves out are removed, with these exceptions:
    • config.enterprise and config.server: only the settings it names change.
    • version, componentDefinition, and lifecycle’s state and deletionPolicy: these keep their current values, so leaving them out doesn’t upgrade, start a stopped deployment, or drop DoNotTerminate.
    • Labels and annotations that other tools manage. These keep their current values when the body leaves them out. Their key prefix is one of:
      • kubeblocks.io/ or falkordb.cloud/, or a subdomain of one, such as apps.kubeblocks.io/ or keel.falkordb.cloud/.
      • app.kubernetes.io/, exactly.
      • A domain in the Admin Server’s ADMIN_SERVER_PRESERVED_LABEL_PREFIXES, or a subdomain of one.
      Legacy falkordb.io/ and falkordb.com/ keys are moved to falkordb.cloud/ with the same name, and kept there.
    To remove a tool-managed label or annotation, PATCH it to null by name, for example {"schemaVersion": 1, "metadata": {"labels": {"keel.falkordb.cloud/cell": null}}}. Setting the whole map to null ("labels": null) removes only the other labels; the tool-managed ones stay. Reserved annotations can’t be removed at all, even by name: those under kubeblocks.io/ or apps.kubeblocks.io/, and the Admin Server’s own TLS, pending-settings and pending Sentinel move annotations. A null for one of them is ignored. A PUT of what a read returns changes nothing. That includes a Sentinel left on an older addon release: to bring it to the data nodes’ definition, PATCH spec.componentDefinition. A Sentinel waiting for the second half of an addon move is the exception: the Admin Server moves it once the data nodes run on their new release (see Move a deployment). Don’t send backup or an inline password again: both are set at create time only.
  • If-Match takes the metadata.generation you read. When the deployment changed since, the update is refused with 412 instead of overwriting the other change. KubeBlocks writes a deployment’s status as it runs, without moving the generation. An update that crosses one of those writes is read again and retried by the Admin Server, up to four times, and answers 409 if the deployment keeps changing. An update that crosses a change to the spec answers 412 when you sent If-Match, and 409 otherwise; one that crosses a change to the labels, the annotations or the maintenance window, which don’t move the generation, answers 409. In each case, read the deployment again and decide.
  • ?dryRun=true returns what the update would do without doing it.
  • An Idempotency-Key header (up to 255 printable ASCII characters) makes a retry safe. See retrying a request.
An update answers with { "schemaVersion": 1, "deployment": {...}, "plan": {...} }. It answers 202 when part of the change is applied after the write: volume growth, and config.enterprise or config.server settings. Those show in status.pendingChanges until they are applied.

Rules an update follows

  • Volumes only grow, and their storage class can’t change.
  • A deployment can’t move between sharded and not sharded, or gain or lose sentinels. A primary with replicas and no sentinels can become a single node and back.
  • The FalkorDB version can’t go back.
  • config.enterprise and config.server change only while the deployment is running. See how settings are applied for which ones restart the pods, and how to reset or empty one.
  • Settings and volume growth are applied after the write, and only while the deployment is running: otherwise they answer 409. A deployment that KubeBlocks reports Failed while every pod is ready counts as running, as status.state reports it.
  • While earlier settings or volume growth still wait to be applied, another update that queues some answers 409. Retry once they are applied.
  • While a Reconfiguring operation runs, an update that sets one of its settings to another value answers 409; the same value is taken as already on its way.
  • A request that stops the deployment can’t also change settings or grow volumes: that answers 422.
  • config.server can’t set the directives the FalkorDB addon manages: the listening port and TLS, accounts (requirepass, user, …), modules, the data directory and file names, replication and cluster wiring, announced addresses, logfile, pidfile, and the switches that open MODULE and DEBUG.
  • GET /api/clusters/{name}/config shows credentials set as enterprise settings only to users who may read the deployment’s credentials (clusters:update). Anyone else sees (redacted).
  • A field set outside this API is not overwritten: the update answers 422 naming it. Add ?overwriteUnmanaged=true to replace it.

How settings are applied

Each setting falls into one of three categories: To undo a change:
  • An enterprise setting set to null goes back to its default. When the default is empty, as with the LDAP settings, null or "" empties it, so setting falkordbe.ldap_servers to null turns LDAP authentication off. An empty value for any other enterprise setting answers 422.
  • A config.graph setting set to null is removed, and the server uses its default.
  • A config.server directive has no default the API knows, so null answers 422: set the value you want. "" empties a directive that is applied on the fly. A directive that needs a restart can’t be emptied, because a bad empty value could keep the pods from starting.
  • A whole section (config.server: null) can’t be removed.

Retrying a request

Send an Idempotency-Key header with a POST, PUT or PATCH to /api/clusters, such as a random ID you generate per change. If the response is lost, send the same request with the same key: it answers with the first response, marked Idempotent-Replayed: true, and changes nothing.
  • The same key with a different request (another route, query or body) answers 422.
  • While the first request is still running, the key answers 409. Retry after a moment.
  • A 5xx, 401, 403, 408 or 429 response doesn’t keep the key, so a retry runs the request again.
  • Keys belong to the user who sent them and are kept for 24 hours.
If the Admin Server stops while it handles a request, nothing records whether the change was made. After about a minute the key is free again, and a retry runs the request again. If someone else changed the deployment in between, a retried PUT or PATCH would overwrite their change. To prevent that, also send If-Match with the metadata.generation you read: the retry then answers 412 instead. Read the deployment again and decide.

Errors

A 400 or 422 lists each problem:

Removed requests

These requests were deprecated in the 1.0 betas and removed in 1.0. The Admin Server answers a create or update body without schemaVersion with 400 and the replacement. The other routes no longer exist and answer 404. Restart, switchover, rebalancing a sharded deployment (/ops/rebalance), moving its slots (/ops/reshard), reconfiguring Sentinel or re-applying settings to the running pods (/ops/configure), and reading or deleting OpsRequests stay: they have no counterpart in the deployment body. With an expired or invalid license, a PATCH that only sets spec.lifecycle.state still starts or stops a deployment, as /ops/start and /ops/stop did.
Reading a deployment without ?schemaVersion=1 still returns the earlier shape.