Skip to content

Commit

Permalink
Merge pull request #2120 from rmweir/add-db-fields
Browse files Browse the repository at this point in the history
Add db fields
  • Loading branch information
FabianKramm authored Oct 31, 2024
2 parents fbda2d6 + 4843937 commit 43266d1
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
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"`
}

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

0 comments on commit 43266d1

Please sign in to comment.