Skip to content

Commit

Permalink
Add update version, reconfiguration ops
Browse files Browse the repository at this point in the history
Signed-off-by: raihankhan <[email protected]>
  • Loading branch information
raihankhan committed May 30, 2024
1 parent 813ee48 commit 370e71b
Show file tree
Hide file tree
Showing 4 changed files with 304 additions and 1 deletion.
86 changes: 85 additions & 1 deletion apis/ops/v1alpha1/openapi_generated.go

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

35 changes: 35 additions & 0 deletions apis/ops/v1alpha1/rabbitmq_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,18 @@ type RabbitMQOpsRequestSpec struct {
DatabaseRef core.LocalObjectReference `json:"databaseRef"`
// Specifies the ops request type: UpdateVersion, HorizontalScaling, VerticalScaling etc.
Type RabbitMQOpsRequestType `json:"type"`
// Specifies information necessary for upgrading rabbitmq
UpdateVersion *RabbitMQUpdateVersionSpec `json:"updateVersion,omitempty"`
// Specifies information necessary for horizontal scaling
HorizontalScaling *RabbitMQHorizontalScalingSpec `json:"horizontalScaling,omitempty"`
// Specifies information necessary for vertical scaling
VerticalScaling *RabbitMQVerticalScalingSpec `json:"verticalScaling,omitempty"`
// Specifies information necessary for volume expansion
VolumeExpansion *RabbitMQVolumeExpansionSpec `json:"volumeExpansion,omitempty"`
// Specifies information necessary for custom configuration of rabbitmq
Configuration *RabbitMQCustomConfigurationSpec `json:"configuration,omitempty"`
// Specifies information necessary for configuring TLS
TLS *TLSSpec `json:"tls,omitempty"`
// Specifies information necessary for restarting database
Restart *RestartSpec `json:"restart,omitempty"`
// Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure.
Expand All @@ -74,6 +80,12 @@ type RabbitMQOpsRequestSpec struct {
// ENUM(UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
type RabbitMQOpsRequestType string

// RabbitMQUpdateVersionSpec contains the update version information of a rabbitmq cluster
type RabbitMQUpdateVersionSpec struct {
// Specifies the target version name from catalog
TargetVersion string `json:"targetVersion,omitempty"`
}

// RabbitMQReplicaReadinessCriteria is the criteria for checking readiness of a RabbitMQ pod
// after updating, horizontal scaling etc.
type RabbitMQReplicaReadinessCriteria struct{}
Expand All @@ -97,6 +109,29 @@ type RabbitMQVolumeExpansionSpec struct {
Node *resource.Quantity `json:"node,omitempty"`
}

// RabbitMQCustomConfigurationSpec is the spec for Reconfiguring the rabbitmq Settings
type RabbitMQCustomConfigurationSpec struct {
// ConfigSecret is an optional field to provide custom configuration file for database.
// +optional
ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"`
// ApplyConfig is an optional field to provide rabbitmq configuration.
// Provided configuration will be applied to config files stored in ConfigSecret.
// If the ConfigSecret is missing, the operator will create a new k8s secret by the
// following naming convention: {db-name}-user-config .
// Expected input format:
// applyConfig:
// file-name.properties: |
// key=value
// server.properties: |
// log.retention.ms=10000
// +optional
ApplyConfig map[string]string `json:"applyConfig,omitempty"`
// If set to "true", the user provided configuration will be removed.
// The rabbitmq cluster will start will default configuration that is generated by the operator.
// +optional
RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// RabbitMQOpsRequestList is a list of RabbitMQOpsRequests
Expand Down
59 changes: 59 additions & 0 deletions apis/ops/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 370e71b

Please sign in to comment.