Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add db fields #2120

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down Expand Up @@ -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": {
Expand Down
5 changes: 5 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 11 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
rmweir marked this conversation as resolved.
Show resolved Hide resolved
}

type DatabaseKine struct {
Expand Down
1 change: 1 addition & 0 deletions config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ controlPlane:
external:
enabled: false
dataSource: ""
connector: ""
certFile: ""
keyFile: ""
caFile: ""
Expand Down
Loading