Skip to content

Commit

Permalink
Add support for MySQL coordinator (#803)
Browse files Browse the repository at this point in the history
Co-authored-by: Tamal Saha <tamal@appscode.com>
Signed-off-by: Mehedi Hasan <mehedi.hasan@appscode.com>
  • Loading branch information
heheh13 and tamalsaha committed Oct 6, 2021
1 parent d1f74f0 commit 47b42be
Show file tree
Hide file tree
Showing 15 changed files with 3,603 additions and 556 deletions.
1,009 changes: 816 additions & 193 deletions apis/catalog/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions apis/catalog/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion apis/catalog/v1alpha1/mysql_version_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ type MySQLVersionSpec struct {
DB MySQLVersionDatabase `json:"db" protobuf:"bytes,3,opt,name=db"`
// Exporter Image
Exporter MySQLVersionExporter `json:"exporter" protobuf:"bytes,4,opt,name=exporter"`
// Coordinator Image
// +optional
Coordinator MySQLVersionCoordinator `json:"coordinator,omitempty" protobuf:"bytes,13,opt,name=coordinator"`
// ReplicationModeDetector Image
ReplicationModeDetector ReplicationModeDetector `json:"replicationModeDetector" protobuf:"bytes,5,opt,name=replicationModeDetector"`
// +optional
ReplicationModeDetector ReplicationModeDetector `json:"replicationModeDetector,omitempty" protobuf:"bytes,5,opt,name=replicationModeDetector"`
// Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded.
// +optional
Deprecated bool `json:"deprecated,omitempty" protobuf:"varint,6,opt,name=deprecated"`
Expand All @@ -73,6 +77,11 @@ type MySQLVersionSpec struct {
// Stash defines backup and restore task definitions.
// +optional
Stash appcat.StashAddonSpec `json:"stash,omitempty" protobuf:"bytes,10,opt,name=stash"`
// Router image
// +optional
Router MySQLVersionRouter `json:"router,omitempty" protobuf:"bytes,11,opt,name=router"`
// +optional
RouterInitContainer MySQLVersionRouterInitContainer `json:"routerInitContainer,omitempty" protobuf:"bytes,12,opt,name=routerInitContainer"`
}

// MySQLVersionDatabase is the MySQL Database image
Expand All @@ -85,11 +94,27 @@ type MySQLVersionExporter struct {
Image string `json:"image" protobuf:"bytes,1,opt,name=image"`
}

// MySQLVersionCoordinator is the image for coordinator
type MySQLVersionCoordinator struct {
Image string `json:"image" protobuf:"bytes,1,opt,name=image"`
}

// MySQLVersionInitContainer is the MySQL Container initializer
type MySQLVersionInitContainer struct {
Image string `json:"image" protobuf:"bytes,1,opt,name=image"`
}

// MySQLVersionRouter is the MySQL Router lightweight middleware
//that provides transparent routing between your application and back-end MySQL Servers
type MySQLVersionRouter struct {
Image string `json:"image" protobuf:"bytes,1,opt,name=image"`
}

// MySQLVersionRouterInitContainer is mysql router init container
type MySQLVersionRouterInitContainer struct {
Image string `json:"image" protobuf:"bytes,1,opt,name=image"`
}

// MySQLVersionPodSecurityPolicy is the MySQL pod security policies
type MySQLVersionPodSecurityPolicy struct {
DatabasePolicyName string `json:"databasePolicyName" protobuf:"bytes,1,opt,name=databasePolicyName"`
Expand Down
90 changes: 88 additions & 2 deletions apis/catalog/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions apis/catalog/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion apis/kubedb/v1alpha2/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,13 @@ const (
// =========================== MySQL Constants ============================
MySQLMetricsExporterConfigSecretSuffix = "metrics-exporter-config"
MySQLDatabasePortName = "db"
MySQLRouterReadWritePortName = "rw"
MySQLRouterReadOnlyPortName = "ro"
MySQLPrimaryServicePortName = "primary"
MySQLStandbyServicePortName = "standby"
MySQLDatabasePort = 3306
MySQLRouterReadWritePort = 6446
MySQLRouterReadOnlyPort = 6447
MySQLGroupComPort = 33060
MySQLMaxGroupMembers = 9
// The recommended MySQL server version for group replication (GR)
Expand All @@ -180,6 +184,12 @@ const (
MySQLTLSConfigFalse = "false"
MySQLTLSConfigPreferred = "preferred"

MySQLRouterContainerName = "mysql-router"

MySQLComponentKey = MySQLKey + "/component"
MySQLComponentDB = "database"
MySQLComponentRouter = "router"

// =========================== PerconaXtraDB Constants ============================
PerconaXtraDBClusterRecommendedVersion = "5.7"
PerconaXtraDBMaxClusterNameLength = 32
Expand Down Expand Up @@ -217,7 +227,6 @@ const (
PostgresDatabasePort = 5432
PostgresPodPrimary = "primary"
PostgresPodStandby = "standby"
PostgresLabelRole = kubedb.GroupName + "/role"
EnvPostgresUser = "POSTGRES_USER"
EnvPostgresPassword = "POSTGRES_PASSWORD"
PostgresCoordinatorContainerName = "pg-coordinator"
Expand Down Expand Up @@ -297,6 +306,8 @@ const (
DatabaseAcceptingConnection = "AcceptingConnection"
// used for Databases that report status OK (also implies that we can connect to it)
DatabaseReady = "Ready"
// used for database that reports ok when all the instances are available
ServerReady = "ServerReady"
// used for Databases that are paused
DatabasePaused = "Paused"
// used for Databases that are halted
Expand Down
Loading

0 comments on commit 47b42be

Please sign in to comment.