diff --git a/chart/values.schema.json b/chart/values.schema.json index 9c248c588..7b84176ec 100755 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -704,7 +704,7 @@ "description": "Embedded defines that an embedded database (sqlite) should be used as the backend for the virtual cluster" }, "external": { - "$ref": "#/$defs/DatabaseKine", + "$ref": "#/$defs/ExternalDatabaseKine", "description": "External defines that an external database should be used as the backend for the virtual cluster" } }, @@ -1581,6 +1581,36 @@ "type": "object", "description": "ExternalConfig holds external configuration" }, + "ExternalDatabaseKine": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled defines if the database should be used." + }, + "dataSource": { + "type": "string", + "description": "DataSource is the kine dataSource to use for the database. This depends on the database format.\nThis is optional for the embedded database. Examples:\n* mysql: mysql://username:password@tcp(hostname:3306)/k3s\n* postgres: postgres://username:password@hostname:5432/k3s" + }, + "keyFile": { + "type": "string", + "description": "KeyFile is the key file to use for the database. This is optional." + }, + "certFile": { + "type": "string", + "description": "CertFile is the cert file to use for the database. This is optional." + }, + "caFile": { + "type": "string", + "description": "CaFile is the ca file to use for the database. This is optional." + }, + "connector": { + "type": "string", + "description": "Connector specifies a secret located in a connected vCluster Platform that contains database server connection information\nto be used by Platform to create a database and database user for the vCluster.\nand non-privileged user. A kine endpoint should be created using the database and user on Platform registration.\nThis is optional." + } + }, + "additionalProperties": false, + "type": "object" + }, "ExternalEtcdHighAvailability": { "properties": { "replicas": { diff --git a/chart/values.yaml b/chart/values.yaml index edc3fff73..f33ba8822 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -307,6 +307,11 @@ controlPlane: # * mysql: mysql://username:password@tcp(hostname:3306)/k3s # * postgres: postgres://username:password@hostname:5432/k3s dataSource: "" + # 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. + connector: "" # CertFile is the cert file to use for the database. This is optional. certFile: "" # KeyFile is the key file to use for the database. This is optional. diff --git a/config/config.go b/config/config.go index 90f82cfbb..b13dbb534 100644 --- a/config/config.go +++ b/config/config.go @@ -1090,7 +1090,17 @@ type Database struct { Embedded DatabaseKine `json:"embedded,omitempty"` // External defines that an external database should be used as the backend for the virtual cluster - External DatabaseKine `json:"external,omitempty"` + External ExternalDatabaseKine `json:"external,omitempty"` +} + +type ExternalDatabaseKine struct { + DatabaseKine + + // 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. + Connector string `json:"connector,omitempty"` } type DatabaseKine struct { diff --git a/config/values.yaml b/config/values.yaml index dbecfd32a..cf382e438 100644 --- a/config/values.yaml +++ b/config/values.yaml @@ -162,6 +162,7 @@ controlPlane: external: enabled: false dataSource: "" + connector: "" certFile: "" keyFile: "" caFile: ""