Skip to content

Commit 9d37f87

Browse files
loft-botdjwfyiclaude
authored
[v4.10.0] docs(doc-1573): clarify platform database, move to air-gapped section, split troubleshoot (#2332) (#2333)
* Backport: Copy platform/administer/clusters/advanced/external-database/external-database.mdx to platform_versioned_docs/version-4.10.0/administer/clusters/advanced/external-database/external-database.mdx * Backport: Copy platform/install/air-gapped/platform-database.mdx to platform_versioned_docs/version-4.10.0/install/air-gapped/platform-database.mdx * Backport: Delete platform_versioned_docs/version-4.10.0/maintenance/platform-database/_category_.json (removed in source) * Backport: Delete platform_versioned_docs/version-4.10.0/maintenance/platform-database/database.mdx (removed in source) * Backport: Copy platform/troubleshoot/platform-database.mdx to platform_versioned_docs/version-4.10.0/troubleshoot/platform-database.mdx * fix(doc-1573): update vcluster overview links to new platform-database path The maintenance/platform-database page was removed by the backport. Point all three vcluster overview versions (next, 0.35.0, 0.34.0) to the new install/air-gapped/platform-database path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Daryl White <daryl.white@loft.sh> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 14fd7b5 commit 9d37f87

8 files changed

Lines changed: 138 additions & 76 deletions

File tree

platform_versioned_docs/version-4.10.0/administer/clusters/advanced/external-database/external-database.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import VersionBadge from '@site/src/components/VersionBadge';
99

1010
<VersionBadge platformVersion="v4.8.0"/>
1111

12+
:::note Unrelated to the Platform Database feature
13+
This page covers the Kine-backed external database used for high-availability multi-replica deployments. If you are looking for the local PostgreSQL instance used for usage reporting in air-gapped environments, see [Platform Database](../../../../install/air-gapped/platform-database.mdx). That is a separate, lighter-weight feature gated to air-gapped installs with offline license keys.
14+
:::
15+
1216
## What is an external database deployment?
1317

1418
An external database deployment runs multiple vCluster Platform replicas in a
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: Platform Database
3+
sidebar_label: Platform Database
4+
sidebar_position: 3
5+
description: The platform database is a local PostgreSQL instance that stores usage snapshots for license reporting in air-gapped installations.
6+
---
7+
8+
import VersionBadge from '@site/src/components/VersionBadge';
9+
10+
<VersionBadge platformVersion="v4.4.0"/>
11+
12+
The platform database is a local PostgreSQL instance provisioned only in air-gapped environments running an [offline license key](./with-offline-license-key.mdx). It stores usage snapshots, which are periodic records of CPU and GPU resource consumption used for license billing. The platform attempts to transmit these snapshots to the vCluster license server every 15 minutes. The local database acts as a staging area. Once a snapshot is successfully transmitted, vCluster's license server holds the authoritative record. Data that has not yet been transmitted exists only in this database.
13+
14+
The platform database does not store core platform state. Tenant cluster definitions, project settings, users, and all other platform objects are stored as Kubernetes custom resources on the control plane cluster. This database exists solely for usage reporting.
15+
16+
:::note Unrelated to the External Database feature
17+
This page covers the local PostgreSQL instance used for usage reporting in air-gapped environments. If you need high availability with multiple platform replicas, see [Platform External Database](../../administer/clusters/advanced/external-database/external-database.mdx). That is a separate feature using a Kine-backed PostgreSQL database as a shared backing store for multi-replica HA deployments, and it requires a fresh installation configured before the platform first starts.
18+
:::
19+
20+
## When the platform database is provisioned
21+
22+
The platform database is only created when all of the following conditions are true at startup:
23+
24+
- The platform is configured with an [offline license key](./with-offline-license-key.mdx) (air-gapped mode).
25+
- The platform is not running as a hosted instance (managed and operated by vCluster Labs on your behalf).
26+
- The active license plan does not disable the platform database.
27+
28+
Standard online-licensed installations do not provision this database. If you do not see a `platform-db` PVC or StatefulSet in your platform namespace, the database is not active in your environment and this page does not apply.
29+
30+
## How the platform database surfaces to administrators
31+
32+
Administrators encounter the platform database in several situations:
33+
34+
**Namespace inspection.** The platform database runs as a StatefulSet in the platform namespace. A routine `kubectl get all` or `kubectl get pvc` will show the `platform-db` StatefulSet, Service, PVC, and Secret alongside platform resources.
35+
36+
**Cluster conditions.** The controller sets `EmbeddedPostgresDeployed` and `EmbeddedPostgresAvailable` conditions on the `Cluster` resource. If the database fails to start, `kubectl describe cluster.storage.loft.sh <cluster-name>` shows a condition message directing you to investigate.
37+
38+
**Platform logs.** If the database is unreachable, the platform logs `error sending usage snapshot` every 15 minutes. Administrators tailing logs during an incident will see this repeating.
39+
40+
**Platform upgrades.** The controller restarts the postgres pods during platform upgrades. Administrators watching pod activity during an upgrade will see `platform-db` pods cycling, which is expected behavior.
41+
42+
See [Troubleshoot Platform Database](../../troubleshoot/platform-database.mdx) for steps to resolve conditions and log errors.
43+
44+
## What usage snapshots record
45+
46+
Each snapshot captures a point-in-time count of resource capacity across the platform, not live workload utilization. The data is used to calculate consumption against the committed amounts in your license.
47+
48+
| Metric | Description |
49+
|---|---|
50+
| Tenant cluster count | Total number of tenant clusters across the platform |
51+
| Node count | Total number of nodes across all connected clusters |
52+
| CPU count | Total CPU capacity across all nodes |
53+
| GPU count | Total GPU capacity across all nodes |
54+
| Per-node detail | Machine ID, creation timestamp, and full resource capacity for each node |
55+
| Per-tenant-cluster detail | Name, namespace, UID, creation timestamp, and node associations |
56+
57+
## Configure
58+
59+
By default, the platform database uses the default StorageClass. To specify a different StorageClass, navigate to `Admin > Config` and edit the `platformDB.storageClass` field.
60+
The value can also be configured in the vCluster Platform Helm values during install or upgrade:
61+
62+
```yaml
63+
platformDB:
64+
storageClass: <storage-class>
65+
```

platform_versioned_docs/version-4.10.0/maintenance/platform-database/_category_.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

platform_versioned_docs/version-4.10.0/maintenance/platform-database/database.mdx

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Troubleshoot Platform Database
3+
sidebar_label: Platform Database
4+
description: Diagnose and resolve platform database issues in air-gapped installations.
5+
---
6+
7+
The platform database is a local PostgreSQL instance provisioned only in air-gapped environments. For background on what it is and how it is configured, see [Platform Database](../install/air-gapped/platform-database.mdx).
8+
9+
If the platform UI shows an **Action Required: Usage History Database Down** banner, the postgres pod is unhealthy. Start with the diagnostics below.
10+
11+
### Diagnose a postgres pod that fails to start
12+
13+
If `kubectl describe cluster.storage.loft.sh <cluster-name>` shows `EmbeddedPostgresAvailable=False`, the postgres pod is not healthy. Check the pod status and events in the platform namespace:
14+
15+
```bash
16+
kubectl get pods -n <platform-namespace> -l loft.sh/system-app=platform-db
17+
kubectl describe pod -n <platform-namespace> -l loft.sh/system-app=platform-db
18+
```
19+
20+
Common causes are storage provisioning failures (the PVC cannot bind to a PersistentVolume) and image pull errors. Resolve the underlying pod issue and the condition should clear on the next reconcile.
21+
22+
### Repeated "error sending usage snapshot" in logs
23+
24+
This error appears every 15 minutes when the platform cannot reach the database. It does not affect platform operation, but usage data is not recorded during the outage. Investigate the postgres pod health as described above.
25+
26+
### Recover from a deleted PVC
27+
28+
The PersistentVolumeClaim named `platform-db` backs the platform database and should never be deleted. Deleting it permanently destroys any usage snapshots that have not yet been transmitted to the vCluster license server. Those snapshots cannot be reconstructed, which creates a gap in the billing record for that period. Snapshots already transmitted to the license server are not affected. In the case that the PVC is deleted, follow these steps to return the platform database to a working state:
29+
30+
1. Set $PLATFORM_NS, $PLATFORM_NAME, and $CLUSTER_NAME based on the name and namespace of the vCluster Platform Deployment.
31+
32+
```bash
33+
export PLATFORM_NS=<platform-namespace>
34+
export PLATFORM_NAME=<platform-deployment-name>
35+
export CLUSTER_NAME=<cluster-name>
36+
```
37+
38+
2. Get current vCluster Platform replicas.
39+
40+
```bash
41+
export DESIRED_REPLICAS=$(kubectl get deployment -n $PLATFORM_NS $PLATFORM_NAME -o json | jq -r '.spec.replicas')
42+
```
43+
44+
3. Scale down vCluster Platform Deployment to 0.
45+
46+
```bash
47+
kubectl scale deployment -n $PLATFORM_NS $PLATFORM_NAME --replicas 0
48+
```
49+
50+
4. Edit the cluster that vCluster Platform is installed in and change the label `loft.sh/platform-db-applied-hash` to a different value, for example add a random letter to the string. Deleting the label will also work.
51+
52+
```bash
53+
kubectl edit cluster.storage.loft.sh $CLUSTER_NAME
54+
```
55+
56+
5. Scale up the platform Deployment to its original replica count.
57+
58+
```bash
59+
kubectl scale deployment -n $PLATFORM_NS $PLATFORM_NAME --replicas $DESIRED_REPLICAS
60+
```
61+
62+
6. Confirm that vCluster Platform database becomes available.
63+
64+
```bash
65+
kubectl rollout status deployment/$PLATFORM_NAME -n $PLATFORM_NS
66+
```

vcluster/production-guide/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Common operations that apply across all paths.
5757
| --- | --- |
5858
| Monitor Platform and tenant workloads | [Monitoring overview](/platform/maintenance/monitoring/overview), [fleet monitoring](/platform/maintenance/monitoring/fleet-monitoring-otel) |
5959
| Back up and restore tenant clusters | [Snapshots](../manage/backup-restore/backup.mdx), [restore](../manage/backup-restore/restore.mdx), [Velero](../manage/backup-restore/velero.mdx) |
60-
| Back up and restore Platform | [Backup and restore Platform](/platform/maintenance/backup-restore/backup-restore-platform), [Platform database](/platform/maintenance/platform-database/database) |
60+
| Back up and restore Platform | [Backup and restore Platform](/platform/maintenance/backup-restore/backup-restore-platform), [Platform database](/platform/install/air-gapped/platform-database) |
6161
| Upgrade Platform and tenant clusters | [Upgrade vCluster](../manage/upgrade/upgrade-version.mdx), [upgrade Platform](/platform/maintenance/upgrade-migrate/upgrade), [lifecycle policy](/platform/maintenance/upgrade-migrate/lifecycle-policy) |
6262
| Rotate certificates | [Certificate rotation](../manage/certificates.mdx) |
6363
| Manage private worker nodes | [Manage private nodes](../deploy/worker-nodes/private-nodes/manage.mdx), [Auto Nodes](/platform/administer/node-providers/overview) |

vcluster_versioned_docs/version-0.34.0/production-guide/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Common operations that apply across all paths.
5757
| --- | --- |
5858
| Monitor Platform and tenant workloads | [Monitoring overview](/platform/maintenance/monitoring/overview), [fleet monitoring](/platform/maintenance/monitoring/fleet-monitoring-otel) |
5959
| Back up and restore tenant clusters | [Snapshots](../manage/backup-restore/backup.mdx), [restore](../manage/backup-restore/restore.mdx), [Velero](../manage/backup-restore/velero.mdx) |
60-
| Back up and restore Platform | [Backup and restore Platform](/platform/maintenance/backup-restore/backup-restore-platform), [Platform database](/platform/maintenance/platform-database/database) |
60+
| Back up and restore Platform | [Backup and restore Platform](/platform/maintenance/backup-restore/backup-restore-platform), [Platform database](/platform/install/air-gapped/platform-database) |
6161
| Upgrade Platform and tenant clusters | [Upgrade vCluster](../manage/upgrade/upgrade-version.mdx), [upgrade Platform](/platform/maintenance/upgrade-migrate/upgrade), [lifecycle policy](/platform/maintenance/upgrade-migrate/lifecycle-policy) |
6262
| Rotate certificates | [Certificate rotation](../manage/certificates.mdx) |
6363
| Manage private worker nodes | [Manage private nodes](../deploy/worker-nodes/private-nodes/manage.mdx), [Auto Nodes](/platform/administer/node-providers/overview) |

vcluster_versioned_docs/version-0.35.0/production-guide/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Common operations that apply across all paths.
5757
| --- | --- |
5858
| Monitor Platform and tenant workloads | [Monitoring overview](/platform/maintenance/monitoring/overview), [fleet monitoring](/platform/maintenance/monitoring/fleet-monitoring-otel) |
5959
| Back up and restore tenant clusters | [Snapshots](../manage/backup-restore/backup.mdx), [restore](../manage/backup-restore/restore.mdx), [Velero](../manage/backup-restore/velero.mdx) |
60-
| Back up and restore Platform | [Backup and restore Platform](/platform/maintenance/backup-restore/backup-restore-platform), [Platform database](/platform/maintenance/platform-database/database) |
60+
| Back up and restore Platform | [Backup and restore Platform](/platform/maintenance/backup-restore/backup-restore-platform), [Platform database](/platform/install/air-gapped/platform-database) |
6161
| Upgrade Platform and tenant clusters | [Upgrade vCluster](../manage/upgrade/upgrade-version.mdx), [upgrade Platform](/platform/maintenance/upgrade-migrate/upgrade), [lifecycle policy](/platform/maintenance/upgrade-migrate/lifecycle-policy) |
6262
| Rotate certificates | [Certificate rotation](../manage/certificates.mdx) |
6363
| Manage private worker nodes | [Manage private nodes](../deploy/worker-nodes/private-nodes/manage.mdx), [Auto Nodes](/platform/administer/node-providers/overview) |

0 commit comments

Comments
 (0)