Platform Database
info
This feature is available from the Platform version v4.4.0
The platform database is a local postgres database server that is used and managed by vCluster Platform.
Configure​
By default, platform database will leverage the default StorageClass. If you would like to specify a different StorageClass, you can navigate to Admin > Config
and edit the platformDB.storageClass
field.
The value can instead be configured using the vCluster Platform values yaml during install or upgrade by adding the following yaml:
platformDB:
storageClass: <storage-class>
Troubleshoot​
The PersistentVolumeClaim that backs the platform database should never be deleted. It is named platform-db
. In the case that it is deleted, the following steps can be followed to return the platform database to a working state.
- Set $PLATFORM_NS and $PLATFORM_NAME, based on the name and namespace of the vCluster Platform Deployment.
Modify the following with your specific values to generate a copyable command:
export PLATFORM_NS=vcluster-platform --namespace vcluster-demo
export PLATFORM_NAME=vcluster-platform
export CLUSTER_NAME=my-platform-cluster
- Get current vCluster Platform replicas.
export DESIRED_REPLICAS=$(kubectl get deployment -n $PLATFORM_NS $PLATFORM_NAME -o json | jq -r '.spec.replicas')
- Scale down vCluster Platform Deployment to 0.
kubectl scale deployment -n $PLATFORM_NS $PLATFORM_NAME --replicas 0
- Edit the cluster that vCluster Platform is installed in and change the label
loft.sh/platform-db-applied-hash
to a different value, e.g. add a random letter to the string. Deleting the label will also work.
kubectl edit cluster.storage.loft.sh $CLUSTER_NAME
- Scale up the loft Deployment to its original replica count.
kubectl scale deployment -n $PLATFORM_NS $PLATFORM_NAME --replicas $DESIRED_REPLICAS
- Confirm that vCluster Platform database becomes available.
kubectl rollout status deployment/$PLATFORM_NAME -n $PLATFORM_NS