-
Notifications
You must be signed in to change notification settings - Fork 235
Conversation
pkg/apis/mysql/v1alpha1/types.go
Outdated
// SSLSecretRef allows a user to specify custom CA certificate, server certificate | ||
// and server key for group replication SSL | ||
// +optional | ||
SSLSecretRef *corev1.LocalObjectReference `json:"sslSecretRef,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/SSLSecretRef/RootPasswordSecret/g
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/SSLSecretRef/SSLSecret/g but i'm guessing that's what you meant ;)
pkg/apis/mysql/v1alpha1/types.go
Outdated
|
||
// ConfigRef allows a user to specify a custom configuration file for MySQL. | ||
// +optional | ||
ConfigRef *corev1.LocalObjectReference `json:"configRef,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ConfigRef/Config/g
?
pkg/apis/mysql/v1alpha1/types.go
Outdated
// If defined, we use this secret for configuring the MYSQL_ROOT_PASSWORD | ||
// If it is not set we generate a secret dynamically | ||
// +optional | ||
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/SecretRef/RootPasswordSecret/
?
pkg/apis/mysql/v1alpha1/types.go
Outdated
// MultiMaster defines the mode of the MySQL cluster. If set to true, | ||
// all instances will be R/W. If false (the default), only a single instance | ||
// will be R/W and the rest will be R/O. | ||
MultiMaster bool `json:"multiMaster,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment and link to why multi-master is probably not what users want.
pkg/apis/mysql/v1alpha1/types.go
Outdated
type ClusterStatus struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata"` | ||
Phase ClusterPhase `json:"phase"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with conditions?
pkg/apis/mysql/v1alpha1/types.go
Outdated
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata"` | ||
Phase ClusterPhase `json:"phase"` | ||
Errors []string `json:"errors"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
pkg/apis/mysql/v1alpha1/types.go
Outdated
// The generation of the backup is configured in the Executor configuration. | ||
type BackupStorageProvider struct { | ||
// Name denotes the type of storage provider that will store and retrieve the backups, | ||
// e.g. s3, oci-s3-compat, aws-s3, gce-s3, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s3 only currently
pkg/apis/mysql/v1alpha1/types.go
Outdated
Name string `json:"name"` | ||
// SecretRef is a reference to the Kubernetes secret containing the configuration for uploading | ||
// the backup to authenticated storage. | ||
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/SecretRef/Secret/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be AuthSecret
or similar? Secret
on it's own is a bit too generic in k8s world i'd say?
pkg/apis/mysql/v1alpha1/types.go
Outdated
// BackupStatus captures the current status of a MySQL backup. | ||
type BackupStatus struct { | ||
// Phase is the current life-cycle phase of the Backup. | ||
Phase BackupPhase `json:"phase"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with conditions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Newer API types should use conditions instead.
You should avoid using phase as it's a deprecated pattern in core.
pkg/apis/mysql/v1alpha1/types.go
Outdated
Outcome BackupOutcome `json:"outcome"` | ||
|
||
// TimeStarted is the time at which the backup was started. | ||
TimeStarted metav1.Time `json:"timeStarted"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can be folded into conditions I think?
pkg/apis/mysql/v1alpha1/types.go
Outdated
// ScheduleStatus captures the current state of a MySQL backup schedule. | ||
type ScheduleStatus struct { | ||
// Phase is the current phase of the MySQL backup schedule. | ||
Phase BackupSchedulePhase `json:"phase"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with conditions?
pkg/apis/mysql/v1alpha1/types.go
Outdated
type RestoreSpec struct { | ||
// ClusterRef is a refeference to the Cluster to which the Restore | ||
// belongs. | ||
ClusterRef *corev1.LocalObjectReference `json:"clusterRef"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ClusterRef/Cluster/
?
pkg/apis/mysql/v1alpha1/types.go
Outdated
ClusterRef *corev1.LocalObjectReference `json:"clusterRef"` | ||
|
||
// BackupRef is a reference to the Backup object to be restored. | ||
BackupRef *corev1.LocalObjectReference `json:"backupRef"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/BackupRef/Backup/
?
pkg/apis/mysql/v1alpha1/types.go
Outdated
// RestoreStatus captures the current status of a MySQL restore. | ||
type RestoreStatus struct { | ||
// Phase is the current life-cycle phase of the Restore. | ||
Phase RestorePhase `json:"phase"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with conditions?
pkg/apis/mysql/v1alpha1/types.go
Outdated
|
||
// If specified, affinity will define the pod's scheduling constraints | ||
// +optional | ||
Affinity *corev1.Affinity `json:"affinity,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Affinity breaks PVC/STS. You sure you want this prior to topology aware CSI?
pkg/apis/mysql/v1alpha1/types.go
Outdated
|
||
// AgentScheduled is the agent hostname to run the backup on. | ||
// TODO(apryde): ScheduledAgent (*corev1.LocalObjectReference)? | ||
AgentScheduled string `json:"agentscheduled"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
ScheduledAgent string
json:"scheduledAgent"
pkg/apis/mysql/v1alpha1/types.go
Outdated
// Name of the tool performing the backup, e.g. mysqldump. | ||
Name string `json:"name"` | ||
// Databases are the databases to backup. | ||
Databases []string `json:"databases"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you ever see this needing more fields under database? Like the table? If so i'd recommend using a struct with a name field.
pkg/apis/mysql/v1alpha1/types.go
Outdated
type BackupStorageProvider struct { | ||
// Name denotes the type of storage provider that will store and retrieve the backups. | ||
// Currently only supports "S3" denoting a S3 compatiable storage provider. | ||
Name string `json:"name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it should be a const.
pkg/apis/mysql/v1alpha1/types.go
Outdated
// BackupStatus captures the current status of a MySQL backup. | ||
type BackupStatus struct { | ||
// Phase is the current life-cycle phase of the Backup. | ||
Phase BackupPhase `json:"phase"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Newer API types should use conditions instead.
You should avoid using phase as it's a deprecated pattern in core.
pkg/apis/mysql/v1alpha1/types.go
Outdated
Backup *corev1.LocalObjectReference `json:"backup"` | ||
|
||
// AgentScheduled is the agent hostname to run the backup on | ||
AgentScheduled string `json:"agentscheduled"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SheduledAgent looks more correct to me. Also camel case on the json field.
Or even AgentName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it Agent
is an implementation detail. ScheduledMember
maybe?
pkg/apis/mysql/v1alpha1/types.go
Outdated
Version string `json:"version"` | ||
|
||
// Replicas defines the number of running MySQL instances in a cluster | ||
Replicas int32 `json:"replicas,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Controversially (perhaps) I'd like to change this to Members
. Replicas
is semantically incorrect for the default and recommended deployment (i.e. single-primary mode). The MySQL documentation discusses cluster "members" and I think we should align with that.
//cc @owainlewis @garthy @jhorwit2
Also Backup/Restore AgentScheduled -> ScheduledMember.
@@ -49,23 +47,23 @@ required = [ | |||
|
|||
[[constraint]] | |||
name = "k8s.io/api" | |||
branch = "release-1.9" | |||
version = "kubernetes-1.10.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependencies need approvals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/user/clusters.md
Outdated
metadata: | ||
name: example-mysql-cluster-with-volume | ||
spec: | ||
replicas: 1 | ||
secretRef: | ||
mem : 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo => members
// TODO (owain) we need to remove this because it's not reasonable for us to maintain a list | ||
// of all the potential MySQL versions that can be used and in reality, it shouldn't matter | ||
// too much. The burden of this is not worth the benfit to a user | ||
var validVersions = []string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed based on the changes done for 0.1.1
@gianlucaborello I’d be very interested on your thoughts on these API changes if you have a moment to take a look at the updated type definitions. |
Took a quick look (without trying it though) and all seems fine to me, overall minor changes from an API perspective. At the moment, as my RFC PRs hint at, my goal is to make sure the cluster membership management logic is as bullet proof as it can be. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes approved.
Started work on making the API more idiomatic prior to v0.2 release. There are still a number of changes to make but feedback at this point would be great.
Includes:
Mysql -> MySQL
Resolves: #119