Skip to main content
Version: main 🚧

External database

Limited vCluster Tenancy Configuration Support

This feature is only available for the following:

Running the control plane as a container and the following worker node types:
  • Host Nodes
  • Private Nodes
  • Enterprise-Only Feature

    This feature is an Enterprise feature. See our pricing plans or contact our sales team for more information.

    Introduction​

    This guide explains how to configure an external database as the backing store for a virtual cluster. A backing store is a persistent storage solution that maintains the state and data of the virtual cluster. Using an external database can provide better performance, scalability, and data persistence compared to the default embedded storage.

    Configure this feature to use an external database such as MySQL or PostgreSQL for your virtual cluster's backing store.

    External database configuration
    controlPlane:
    backingStore:
    database:
    external:
    enabled: true
    dataSource: CONNECTION_STRING
    connector: CONNECTOR_STRING

    Connector and data source​

    There are two mutually exclusive options for using an external backing store.

    dataSource: assign a connection string to dataSource that the virtual cluster uses for its control plane backing store.

    connector: assign a name of a connector secret that exists in an instance of the platform in the installed namespace. The platform uses the secret to automatically provision a separate database within the database server for the virtual cluster. It also creates a non-privileged user that can only interact with the virtual cluster's database. The virtual cluster receives a connection string built from the user and database.

    ConnectorDataSource
    MySQL SupportYesYes
    PostgreSQL SupportYesYes
    Share Across virtual clustersYesNo
    Automatic DB CleanupYesNo
    Credential stored in secretYesNo

    Datasource configuration​

    Replace CONNECTION_STRING with the connection string for your database. Examples:

    • PostgreSQL: postgres://username:password@hostname:5432/vcluster-db
    • MySQL: mysql://root:password@tcp(192.168.86.9:30360)/vcluster

    Connector configuration​

    An administrator must first set up a database connector secret in the platform. Your virtual cluster must have access to the platform.

    Once the connector secret has been configured, assign the name of the secret to the connector field.

    note

    Any virtual cluster can connect to the platform. This is usually done by configuring a platform API key. Connecting to the platform allows for centralized management and monitoring of virtual clusters, enhancing overall operational efficiency.

    Config reference​

    external required object ​

    External defines that an external database should be used as the backend for the virtual cluster

    enabled required boolean false ​

    Enabled defines if the database should be used.

    dataSource required string ​

    DataSource is the kine dataSource to use for the database. This depends on the database format. This is optional for the embedded database. Examples:

    • mysql: mysql://username:password@tcp(hostname:3306)/k3s
    • postgres: postgres://username:password@hostname:5432/k3s

    keyFile required string ​

    KeyFile is the key file to use for the database. This is optional.

    certFile required string ​

    CertFile is the cert file to use for the database. This is optional.

    caFile required string ​

    CaFile is the ca file to use for the database. This is optional.

    extraArgs required string[] [] ​

    ExtraArgs are additional arguments to pass to Kine.

    connector required string ​

    Connector specifies a secret located in a connected vCluster Platform that contains database server connection information to be used by Platform to create a database and database user for the vCluster. and non-privileged user. A kine endpoint should be created using the database and user on Platform registration. This is optional.