Deploy the control plane¶
What you will end up with¶
A running control plane in a namespace you choose, serving its API on port 8080, with its storage backend, store profile and control-plane identity latched and verified.
Prerequisites¶
kubectlpointing at the target cluster, with rights to create a namespace and a Deployment in it.jqon your path.- The platform images reachable from the cluster.
- A decided storage backend and profile. Both are latched on this first start and cannot be changed afterwards. See Storage backends and profiles.
export CP_NS=xratu-cp
export CP_SERVICE=xratu-control-plane
export CP_PORT=8080
export XRATU_IMAGE_REGISTRY=<xratu-published-registry>
export XRATU_VERSION=<release-tag>
1. Create the namespace¶
2. Choose the backend before you render¶
The shipped manifest carries a file-backed bootstrap configuration:
- name: XRATU_CP_DB_BACKEND
value: "sqlite"
- name: XRATU_CP_DB_PATH
value: "/data/control_plane.db"
Leave it as it is only for a throwaway deployment. A finalized control plane
requires postgres, and one latched on the file-backed default will fail its
own readiness check once finalized.
For anything you intend to keep, create a Secret holding the connection string and replace that block in the manifest before applying:
kubectl -n ${CP_NS} create secret generic xratu-cp-store \
--from-literal=dsn='postgresql://xratu:<password>@postgres.internal:5432/xratu?sslmode=require' \
--dry-run=client -o yaml | kubectl apply -f -
- name: XRATU_CP_DB_BACKEND
value: "postgres"
- name: XRATU_CP_DB_DSN
valueFrom:
secretKeyRef:
name: xratu-cp-store
key: dsn
- name: XRATU_CP_STORE_PROFILE
value: "durable"
Apply that block to all three containers, since each runs the same store configuration.
3. Render and apply¶
The manifest carries two placeholders: the namespace and the image.
sed \
-e "s|namespace: xratu-cp|namespace: ${CP_NS}|g" \
-e "s|REPLACE_CONTROL_PLANE_IMAGE|${XRATU_IMAGE_REGISTRY}/xratu-control-plane:${XRATU_VERSION}|g" \
control_plane/templates/deployment/k8s-control-plane.yaml | kubectl apply -f -
This creates three objects: a PersistentVolumeClaim, the Deployment, and
the Service.
4. Wait for the rollout¶
Expected output¶
The rollout reports the deployment successfully rolled out. The pod runs three containers, and the deployment shows one replica available.
kubectl -n ${CP_NS} get deploy,svc,pods -o wide
kubectl -n ${CP_NS} get pods -o jsonpath='{.items[0].spec.containers[*].name}{"\n"}'
The container list is api controller scheduler.
Startup is gated by a probe against /v1/system/health/startup with a
ten-second period and a threshold of thirty, so the pod has up to five minutes
to satisfy its startup invariants before Kubernetes gives up on it.
5. Verify it worked¶
Reach the API. A port-forward is the recommended default for a self-hosted cluster; see Expose the control-plane API for the alternatives.
kubectl -n ${CP_NS} port-forward svc/${CP_SERVICE} 18080:${CP_PORT} &
export CP_CLI_ENDPOINT="http://127.0.0.1:18080"
Check all three health endpoints:
curl -fsS "${CP_CLI_ENDPOINT}/v1/system/health/startup" >/dev/null && echo "startup ok"
curl -fsS "${CP_CLI_ENDPOINT}/v1/system/health/readiness" >/dev/null && echo "readiness ok"
curl -fsS "${CP_CLI_ENDPOINT}/v1/system/health/liveness" >/dev/null && echo "liveness ok"
Then verify the identity latch and the storage values it recorded:
curl -fsS "${CP_CLI_ENDPOINT}/v1/system/health/readiness" \
| jq '{db_backend, store_profile, finalization}'
On a deployment that has not yet been finalized, finalization reports
bootstrap_finalized: false and nothing else, while db_backend and
store_profile report what the process is actually running. Confirm those two
are the values you intended, because they are what a later activation latches.
On a finalized deployment, finalization additionally carries
cp_instance_uuid, cp_identity_revision, locked_db_backend and
locked_store_profile. The locked pair must equal the observed pair. See
The identity latch.
When it fails¶
The rollout times out and pods show ImagePullBackOff. The cluster cannot
pull the image. Check the reference and the registry's reachability:
The pod runs but never becomes ready. The startup or readiness check is failing an invariant, and the message names which one. Read it directly:
Restarting will not help, because the next start evaluates the same set. See Finalization invariants and fail-closed startup.
Readiness reports backend or store profile drift. The deployment's environment no longer matches what was latched. Restore the environment; the latch cannot be changed.
readiness returns 503 mentioning a shared secret. A finalized deployment
requires auth.runtime_shared_secret to be configured.
The port-forward connects but every CLI command fails. That is expected at this point. The CLI has no profile or token yet. See Configure a CLI profile.
What changed¶
A namespace now holds a control-plane Deployment, its volume claim and its Service. The API answers on port 8080, the store is running the backend and profile you chose, and the deployment has an identity.
Nothing outside the cluster changed, and no tenancy exists yet: there is no organisation, no workspace and no actor beyond the system one.
Next in the sequence is reaching the control plane from your CLI and exchanging an identity, which Self-hosted deployment carries end to end.