Skip to content

Commit

Permalink
release v1.6.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
dingfeng committed Apr 19, 2024
1 parent 2ce6dae commit 3196e6c
Show file tree
Hide file tree
Showing 221 changed files with 15,695 additions and 2,494 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please refer to the [CHANGELOG](./CHANGELOG.md) for the notable changes for each
Refer to the documentations for more details, such as CRD definitions and operation guides.

+ [简体中文](https://doc.polardbx.com/quickstart/topics/quickstart-k8s.html)
+ English(TODO)
+ [English](https://doc.polardbx.com/en/quickstart/topics/quickstart-k8s.html)

如对文档有疑问,可提Issue或者Pull Request到[文档仓库](https://github.com/polardb/polardbx-operator-docs)

Expand Down
2 changes: 1 addition & 1 deletion api/v1/common/zz_generated.deepcopy.go

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

16 changes: 16 additions & 0 deletions api/v1/polardbx/backup_storage.go → api/v1/polardbx/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,19 @@ func NewBackupStorageFilestreamAction(storage BackupStorage) (*BackupStorageFile
return nil, errors.New("invalid storage: " + string(storage))
}
}

type CleanPolicyType string

const (
// CleanPolicyRetain represents that remote backup files will be retained
// when the backup object is deleted in any case.
CleanPolicyRetain CleanPolicyType = "Retain"

// CleanPolicyDelete represents that remote backup files will be deleted
// when the backup object is deleted in any case.
CleanPolicyDelete CleanPolicyType = "Delete"

// CleanPolicyOnFailure represents that if backup failed, remote backup files will be deleted
// when the backup object is deleted.
CleanPolicyOnFailure CleanPolicyType = "OnFailure"
)
3 changes: 3 additions & 0 deletions api/v1/polardbx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ type CDCConfig struct {

type ColumnarConfig struct {
Envs map[string]intstr.IntOrString `json:"envs,omitempty"`

// ColumnarDataFileStorage defines the file storage used to store cold data
ColumnarDataFileStorage []FileStorageInfo `json:"columnarDataFileStorage,omitempty"`
}

type Config struct {
Expand Down
3 changes: 2 additions & 1 deletion api/v1/polardbx/file_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package polardbx
import "strings"

type FileStorageInfo struct {
// +kubebuilder:validation:Pattern=`^(?i)innodb|mrg_myisam|blackhole|myisam|csv|archive|performance_schema|federated|local_disk|s3|oss$`
// +kubebuilder:validation:Pattern=`^(?i)innodb|mrg_myisam|blackhole|myisam|csv|archive|performance_schema|federated|local_disk|external_disk|s3|oss$`
// +kubebuilder:validation:Required

// Engine describes the engine type of file storage
Expand All @@ -38,6 +38,7 @@ const (
EngineTypePerformanceSchema EngineType = "PERFORMANCE_SCHEMA"
EngineTypeFederated EngineType = "FEDERATED"
EngineTypeLocalDisk EngineType = "LOCAL_DISK"
EngineTypeExternalDisk EngineType = "EXTERNAL_DISK"
EngineTypeS3 EngineType = "S3"
EngineTypeOss EngineType = "OSS"
)
Expand Down
1 change: 1 addition & 0 deletions api/v1/polardbx/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
PhaseFailed Phase = "Failed"
PhaseRestarting Phase = "Restarting"
PhaseUnknown Phase = "Unknown"
PhaseTdeOpening Phase = "TdeOpening"
)

// Stage defines the operating stage of the cluster.
Expand Down
29 changes: 29 additions & 0 deletions api/v1/polardbx/tde.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright 2022 Alibaba Group Holding Limited.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package polardbx

type TDE struct {
// Enable represents whether tde is enabled
// +kubebuilder:default=false
// +optional
Enable bool `json:"enable,omitempty"`

// KeyringPath represents the keyring path
// +kubebuilder:default=/data/mysql/mysql-keyring/keyring
// +optional
KeyringPath string `json:"keyringPath,omitempty"`
}
22 changes: 21 additions & 1 deletion api/v1/polardbx/zz_generated.deepcopy.go

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

29 changes: 14 additions & 15 deletions api/v1/polardbxbackup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ type PolarDBXClusterReference struct {
UID types.UID `json:"uid,omitempty"`
}

type CleanPolicyType string

const (
// CleanPolicyRetain represents that the backup files will be retained when the cluster is deleted.
CleanPolicyRetain CleanPolicyType = "Retain"

// CleanPolicyDelete represents that the backup files will be deleted when the cluster is deleted.
CleanPolicyDelete CleanPolicyType = "Delete"

// CleanPolicyOnFailure represents that the backup object will be deleted when the backup is failed.
CleanPolicyOnFailure CleanPolicyType = "OnFailure"
)

// PolarDBXBackupSpec defines the desired state of PolarDBXBackup
type PolarDBXBackupSpec struct {
// Cluster represents the reference of target polardbx cluster to perform the backup action.
Expand All @@ -52,9 +39,10 @@ type PolarDBXBackupSpec struct {
// +kubebuilder:default=Retain
// +kubebuilder:validation:Enum=Retain;Delete;OnFailure

// CleanPolicy defines the clean policy when cluster is deleted. Default is Retain.
// CleanPolicy defines the clean policy for remote backup files when object of PolarDBXBackup is deleted.
// Default is Retain.
// +optional
CleanPolicy CleanPolicyType `json:"cleanPolicy,omitempty"`
CleanPolicy polardbx.CleanPolicyType `json:"cleanPolicy,omitempty"`

// StorageProvider defines the backend storage to store the backup files.
StorageProvider polardbx.BackupStorageProvider `json:"storageProvider,omitempty"`
Expand All @@ -80,6 +68,7 @@ const (
BackupFinished PolarDBXBackupPhase = "Finished"
BackupFailed PolarDBXBackupPhase = "Failed"
BackupDummy PolarDBXBackupPhase = "Dummy"
BackupDeleting PolarDBXBackupPhase = "Deleting"
)

// PolarDBXBackupStatus defines the observed state of PolarDBXBackup
Expand All @@ -100,6 +89,10 @@ type PolarDBXBackupStatus struct {
// +optional
Reason string `json:"reason,omitempty"`

// Message includes human-readable message related to current status.
// +optional
Message string `json:"message,omitempty"`

// Backups represents the underlying backup objects of xstore. The key is
// cluster name, and the value is the backup name.
// +optional
Expand Down Expand Up @@ -127,6 +120,12 @@ type PolarDBXBackupStatus struct {

// LatestRecoverableTimestamp records the latest timestamp that can recover from current backup set
LatestRecoverableTimestamp *metav1.Time `json:"latestRecoverableTimestamp,omitempty"`

// CollectStartIndexMap records xstore name and the binlog index where collect should begin
CollectStartIndexMap map[string]string `json:"collectStartIndexMap,omitempty"`

// CollectEndIndexMap records xstore name and the binlog index where collect should begin
CollectEndIndexMap map[string]string `json:"collectEndIndexMap,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
16 changes: 16 additions & 0 deletions api/v1/polardbxcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ type PolarDBXClusterSpec struct {
// InitReadonly is the list of readonly cluster that needs to be created and initialized
// +optional
InitReadonly []*polardbx.ReadonlyParam `json:"initReadonly,omitempty"`

// TDE defines the transparent data encryption of clusters
// +optional
TDE polardbx.TDE `json:"tde,omitempty"`

// Exclusive if true, it means more resource isolation.
// +optional
Exclusive bool `json:"exclusive,omitempty"`
}

type PolarDBXClusterStatus struct {
Expand Down Expand Up @@ -134,6 +142,14 @@ type PolarDBXClusterStatus struct {

//LatestSyncReadonlyTs represents the lastest time sync readonly storage info to metadb
ReadonlyStorageInfoHash string `json:"readonlyStorageInfoHash,omitempty"`

// +kubebuilder:default=false
// TdeStatus represents if tde open
TdeStatus bool `json:"tdeStatus,omitempty"`

// Message includes human-readable message related to current status.
// +optional
Message string `json:"message,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
2 changes: 1 addition & 1 deletion api/v1/systemtask/zz_generated.deepcopy.go

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

6 changes: 6 additions & 0 deletions api/v1/xstore/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ type Condition struct {
// +optional
Message string `json:"message,omitempty"`
}

// PitrStatus represents the status ot pitr restore
type PitrStatus struct {
PrepareJobEndpoint string `json:"prepareJobEndpoint,omitempty"`
Job string `json:"job,omitempty"`
}
1 change: 1 addition & 0 deletions api/v1/xstore/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
PhaseRestarting Phase = "Restarting"
PhaseUnknown Phase = "Unknown"
PhaseAdapting Phase = "Adapting"
PhaseTdeOpening Phase = "PhaseTdeOpening"
)

type Stage string
Expand Down
17 changes: 16 additions & 1 deletion api/v1/xstore/zz_generated.deepcopy.go

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

49 changes: 48 additions & 1 deletion api/v1/xstore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1

import (
"github.com/alibaba/polardbx-operator/api/v1/polardbx"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand All @@ -33,6 +34,9 @@ type XStoreRestoreFrom struct {
// BackupSelector defines the selector for the backups to be selected. Optional.
// +optional
BackupSelector map[string]string `json:"backupSelector,omitempty"`

// BackupSetPath defines the location of backup set in remote storage
BackupSetPath string `json:"backupSetPath,omitempty"`
}

// XStoreRestoreSpec defines the specification for restore a xstore with desired state.
Expand All @@ -43,6 +47,10 @@ type XStoreRestoreSpec struct {
// From defines the source information, either backup sets, snapshot or an running cluster.
From XStoreRestoreFrom `json:"from,omitempty"`

// StorageProvider defines storage used to perform backup
// +optional
StorageProvider *polardbx.BackupStorageProvider `json:"storageProvider,omitempty"`

// Time defines the specified time of the restored data, in the format of 'yyyy-MM-dd HH:mm:ss'. Required.
Time string `json:"time,omitempty"`

Expand All @@ -51,10 +59,34 @@ type XStoreRestoreSpec struct {
TimeZone string `json:"timezone,omitempty"`

PitrEndpoint string `json:"pitrEndpoiint,omitempty"`

// BinlogSource defines the binlog datasource
// +optional
BinlogSource *RestoreBinlogSource `json:"binlogSource,omitempty"`
}

type TDE struct {
// +kubebuilder:default=false
// +optional
Enable bool `json:"enable,omitempty"`

// +kubebuilder:default=/data/mysql/mysql-keyring/keyring
// +optional
KeyringPath string `json:"keyringPath,omitempty"`
}

// RestoreBinlogSource defines the binlog datasource
type RestoreBinlogSource struct {
//Namespace defines the source binlog namespace
Namespace string `json:"namespace,omitempty"`
//Checksum defines the binlog file checksum.
Checksum string `json:"checksum,omitempty"`
//StorageProvider defines the source binlog sink
StorageProvider *polardbx.BackupStorageProvider `json:"storageProvider,omitempty"`
}

type XStoreSpec struct {
// +kubebuilder:default="galaxy"
// +kubebuilder:default=galaxy

// Engine is the engine used by xstore. Default is "galaxy".
// +optional
Expand Down Expand Up @@ -112,6 +144,14 @@ type XStoreSpec struct {
// Restore defines the spec of restore.
// +optional
Restore *XStoreRestoreSpec `json:"restore,omitempty"`

// TDE defines the transparent data encryption of clusters
// +optional
TDE TDE `json:"tde,omitempty"`

// Exclusive if true, it means more resource isolation.
// +optional
Exclusive bool `json:"exclusive,omitempty"`
}

type XStoreStatus struct {
Expand Down Expand Up @@ -183,6 +223,13 @@ type XStoreStatus struct {

// RestartingPods represents pods need to restart
RestartingPods xstore.RestartingPods `json:"restartingPods,omitempty"`

//PitrStatus represents the status of the pitr restore
PitrStatus *xstore.PitrStatus `json:"pitrStatus,omitempty"`

// +kubebuilder:default=false
// TdeStatus represents if tde open
TdeStatus bool `json:"tdeStatus,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
Loading

0 comments on commit 3196e6c

Please sign in to comment.