Skip to content

Commit

Permalink
chore: adapt cluster update and dataprotection commands
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyelei committed Oct 22, 2024
1 parent ae1093d commit 3c42554
Show file tree
Hide file tree
Showing 50 changed files with 1,956 additions and 1,444 deletions.
2 changes: 1 addition & 1 deletion addons
Submodule addons updated 84 files
+3 −0 .shellspec
+1 −1 addons-cluster/clickhouse/templates/cluster.yaml
+3 −3 addons-cluster/minio/values.schema.json
+2 −1 addons-cluster/mongodb/templates/cluster.yaml
+3 −3 addons-cluster/mysql/values.schema.json
+1 −1 addons-cluster/mysql/values.yaml
+2 −2 addons-cluster/postgresql/values.schema.json
+1 −1 addons-cluster/redis/templates/cluster.yaml
+3 −2 addons-cluster/zookeeper/templates/cluster.yaml
+6 −2 addons-cluster/zookeeper/values.yaml
+10 −14 addons/apecloud-mysql/templates/backuppolicytemplate.yaml
+9 −12 addons/apecloud-mysql/templates/backuppolicytemplateforhscale.yaml
+1 −1 addons/apecloud-mysql/values.yaml
+1 −1 addons/apecloud-postgresql/values.yaml
+5 −6 addons/elasticsearch/templates/backuppolicytemplate.yaml
+24 −25 addons/etcd/templates/backuppolicytemplate.yaml
+0 −2 addons/mariadb/templates/actionset.yaml
+16 −17 addons/mariadb/templates/backuppolicytemplate.yaml
+15 −16 addons/milvus/templates/backuppolicytemplate.yaml
+24 −8 addons/minio/templates/cmpd.yaml
+15 −14 addons/mogdb/templates/backuppolicytemplate.yaml
+69 −0 addons/mongodb/scripts-ut-spec/replicaset_setup_spec.sh
+0 −74 addons/mongodb/scripts/replicaset-post-start.tpl
+3 −13 addons/mongodb/scripts/replicaset-setup.tpl
+25 −0 addons/mongodb/templates/_helpers.tpl
+40 −42 addons/mongodb/templates/backuppolicytemplate.yaml
+2 −2 addons/mongodb/templates/clusterdefinition.yaml
+18 −4 addons/mongodb/templates/componentdefinition.yaml
+1 −1 addons/mongodb/templates/componentversion.yaml
+2 −88 addons/mongodb/templates/scriptstemplate.yaml
+7 −64 addons/mongodb/values.yaml
+1,102 −0 addons/mysql/config/mysql5.7-config-constraint.cue
+362 −0 addons/mysql/config/mysql5.7-config-effect-scope.yaml
+47 −47 addons/mysql/templates/backuppolicytemplate.yaml
+21 −20 addons/mysql/templates/backuppolicytemplateforhscale.yaml
+1 −1 addons/mysql/templates/cmpd-mysql57-orc.yaml
+1 −1 addons/mysql/templates/cmpd-mysql57.yaml
+1 −1 addons/mysql/templates/cmpd-mysql80-orc.yaml
+1 −1 addons/mysql/templates/cmpd-mysql80.yaml
+1 −1 addons/mysql/templates/cmpd-mysql84.yaml
+61 −0 addons/mysql/templates/config-constraint-57.yaml
+1 −1 addons/mysql/templates/config-constraint-80.yaml
+1 −1 addons/mysql/values.yaml
+18 −28 addons/oceanbase-ce/templates/backuppolicytemplate.yaml
+1 −1 addons/oceanbase-ce/values.yaml
+86 −91 addons/postgresql/templates/backuppolicytemplate.yaml
+1 −1 addons/postgresql/templates/componentdefinition-12.yaml
+1 −1 addons/postgresql/templates/componentdefinition-14.yaml
+1 −1 addons/postgresql/templates/componentdefinition-15.yaml
+1 −1 addons/postgresql/templates/componentdefinition-16.yaml
+3 −0 addons/postgresql/templates/componentversion.yaml
+1 −1 addons/postgresql/values.yaml
+19 −21 addons/qdrant/templates/backuppolicytemplate.yaml
+3 −0 addons/rabbitmq/templates/componentdefinition.yaml
+626 −0 addons/redis/redis-cluster-scripts/redis-cluster-common.sh
+248 −305 addons/redis/redis-cluster-scripts/redis-cluster-manage.sh
+71 −55 addons/redis/redis-cluster-scripts/redis-cluster-replica-member-leave.sh
+213 −318 addons/redis/redis-cluster-scripts/redis-cluster-server-start.sh
+528 −0 addons/redis/scripts-ut-spec/redis_cluster_common_spec.sh
+1,817 −0 addons/redis/scripts-ut-spec/redis_cluster_manage_spec.sh
+265 −0 addons/redis/scripts-ut-spec/redis_cluster_replica_member_leave_spec.sh
+853 −0 addons/redis/scripts-ut-spec/redis_cluster_server_start_spec.sh
+4 −4 addons/redis/scripts/redis-start.sh
+35 −63 addons/redis/templates/backuppolicytemplate.yaml
+33 −0 addons/redis/templates/backuppolicytemplateforcluster.yaml
+69 −43 addons/redis/templates/cmpd-redis-cluster-7.yaml
+15 −1 addons/redis/templates/redis-cluster7-scripts-template.yaml
+1 −1 addons/redis/values.yaml
+8 −9 addons/tidb/templates/backuppolicytemplate.yaml
+15 −16 addons/weaviate/templates/backuppolicytemplate.yaml
+106 −0 addons/zookeeper/scripts-ut-spec/roleprobe_spec.sh
+149 −0 addons/zookeeper/scripts-ut-spec/startup_spec.sh
+35 −0 addons/zookeeper/scripts/roleprobe.sh
+54 −24 addons/zookeeper/scripts/startup.sh
+54 −0 addons/zookeeper/templates/_helpers.tpl
+2 −2 addons/zookeeper/templates/backupactionset.yaml
+22 −24 addons/zookeeper/templates/backuppolicytemplate.yaml
+51 −58 addons/zookeeper/templates/cmpd.yaml
+6 −1 addons/zookeeper/templates/cmpv.yaml
+1 −1 addons/zookeeper/templates/config-configmap.yaml
+1 −1 addons/zookeeper/templates/configconstraint.yaml
+1 −1 addons/zookeeper/templates/log-config-configmap.yaml
+4 −2 addons/zookeeper/templates/scripts.yaml
+10 −6 addons/zookeeper/values.yaml
12 changes: 10 additions & 2 deletions docs/user_docs/cli/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ BackupRepo command.
* [kbcli backuprepo delete](kbcli_backuprepo_delete.md) - Delete a backup repository.
* [kbcli backuprepo describe](kbcli_backuprepo_describe.md) - Describe a backup repository.
* [kbcli backuprepo list](kbcli_backuprepo_list.md) - List Backup Repositories.
* [kbcli backuprepo list-storage-provider](kbcli_backuprepo_list-storage-provider.md) - List storage providers.
* [kbcli backuprepo update](kbcli_backuprepo_update.md) - Update a backup repository.


Expand All @@ -48,20 +49,22 @@ Cluster command.
* [kbcli cluster describe-backup-policy](kbcli_cluster_describe-backup-policy.md) - Describe backup policy
* [kbcli cluster describe-config](kbcli_cluster_describe-config.md) - Show details of a specific reconfiguring.
* [kbcli cluster describe-ops](kbcli_cluster_describe-ops.md) - Show details of a specific OpsRequest.
* [kbcli cluster describe-restore](kbcli_cluster_describe-restore.md) - Describe a restore
* [kbcli cluster diff-config](kbcli_cluster_diff-config.md) - Show the difference in parameters between the two submitted OpsRequest.
* [kbcli cluster edit-backup-policy](kbcli_cluster_edit-backup-policy.md) - Edit backup policy
* [kbcli cluster edit-config](kbcli_cluster_edit-config.md) - Edit the config file of the component.
* [kbcli cluster explain-config](kbcli_cluster_explain-config.md) - List the constraint for supported configuration params.
* [kbcli cluster expose](kbcli_cluster_expose.md) - Expose a cluster with a new endpoint, the new endpoint can be found by executing 'kbcli cluster describe NAME'.
* [kbcli cluster label](kbcli_cluster_label.md) - Update the labels on cluster
* [kbcli cluster list](kbcli_cluster_list.md) - List clusters.
* [kbcli cluster list-backup](kbcli_cluster_list-backup.md) - List backups.
* [kbcli cluster list-backup-policy](kbcli_cluster_list-backup-policy.md) - List backups policies.
* [kbcli cluster list-backups](kbcli_cluster_list-backups.md) - List backups.
* [kbcli cluster list-components](kbcli_cluster_list-components.md) - List cluster components.
* [kbcli cluster list-events](kbcli_cluster_list-events.md) - List cluster events.
* [kbcli cluster list-instances](kbcli_cluster_list-instances.md) - List cluster instances.
* [kbcli cluster list-logs](kbcli_cluster_list-logs.md) - List supported log files in cluster.
* [kbcli cluster list-ops](kbcli_cluster_list-ops.md) - List all opsRequests.
* [kbcli cluster list-restore](kbcli_cluster_list-restore.md) - List restores.
* [kbcli cluster logs](kbcli_cluster_logs.md) - Access cluster log file.
* [kbcli cluster promote](kbcli_cluster_promote.md) - Promote a non-primary or non-leader instance as the new primary or leader of the cluster
* [kbcli cluster rebuild-instance](kbcli_cluster_rebuild-instance.md) - Rebuild the specified instances in the cluster.
Expand Down Expand Up @@ -104,8 +107,13 @@ Data protection command.
* [kbcli dataprotection delete-backup](kbcli_dataprotection_delete-backup.md) - Delete a backup.
* [kbcli dataprotection describe-backup](kbcli_dataprotection_describe-backup.md) - Describe a backup
* [kbcli dataprotection describe-backup-policy](kbcli_dataprotection_describe-backup-policy.md) - Describe a backup policy
* [kbcli dataprotection describe-restore](kbcli_dataprotection_describe-restore.md) - Describe a restore
* [kbcli dataprotection edit-backup-policy](kbcli_dataprotection_edit-backup-policy.md) - Edit backup policy
* [kbcli dataprotection list-action-set](kbcli_dataprotection_list-action-set.md) - List actionsets
* [kbcli dataprotection list-backup](kbcli_dataprotection_list-backup.md) - List backups.
* [kbcli dataprotection list-backup-policy](kbcli_dataprotection_list-backup-policy.md) - List backup policies
* [kbcli dataprotection list-backups](kbcli_dataprotection_list-backups.md) - List backups.
* [kbcli dataprotection list-backup-policy-template](kbcli_dataprotection_list-backup-policy-template.md) - List backup policy template
* [kbcli dataprotection list-restore](kbcli_dataprotection_list-restore.md) - List restores.
* [kbcli dataprotection restore](kbcli_dataprotection_restore.md) - Restore a new cluster from backup


Expand Down
1 change: 1 addition & 0 deletions docs/user_docs/cli/kbcli_backuprepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ BackupRepo command.
* [kbcli backuprepo delete](kbcli_backuprepo_delete.md) - Delete a backup repository.
* [kbcli backuprepo describe](kbcli_backuprepo_describe.md) - Describe a backup repository.
* [kbcli backuprepo list](kbcli_backuprepo_list.md) - List Backup Repositories.
* [kbcli backuprepo list-storage-provider](kbcli_backuprepo_list-storage-provider.md) - List storage providers.
* [kbcli backuprepo update](kbcli_backuprepo_update.md) - Update a backup repository.

#### Go Back to [CLI Overview](cli.md) Homepage.
Expand Down
12 changes: 6 additions & 6 deletions docs/user_docs/cli/kbcli_backuprepo_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ kbcli backuprepo list [flags]
### Options

```
-A, --all-namespaces If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
-h, --help help for list
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml, wide (default table)
-l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.
--show-labels When printing, show all labels as the last column (default hide labels column)
-A, --all-namespaces If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
-h, --help help for list
-n, --namespace string specified the namespace
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml, wide (default table)
-l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.
--show-labels When printing, show all labels as the last column (default hide labels column)
```

### Options inherited from parent commands
Expand All @@ -41,7 +42,6 @@ kbcli backuprepo list [flags]
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
--match-server-version Require server version to match client version
-n, --namespace string If present, the namespace scope for this CLI request
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
-s, --server string The address and port of the Kubernetes API server
--tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
Expand Down
4 changes: 3 additions & 1 deletion docs/user_docs/cli/kbcli_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,22 @@ Cluster command.
* [kbcli cluster describe-backup-policy](kbcli_cluster_describe-backup-policy.md) - Describe backup policy
* [kbcli cluster describe-config](kbcli_cluster_describe-config.md) - Show details of a specific reconfiguring.
* [kbcli cluster describe-ops](kbcli_cluster_describe-ops.md) - Show details of a specific OpsRequest.
* [kbcli cluster describe-restore](kbcli_cluster_describe-restore.md) - Describe a restore
* [kbcli cluster diff-config](kbcli_cluster_diff-config.md) - Show the difference in parameters between the two submitted OpsRequest.
* [kbcli cluster edit-backup-policy](kbcli_cluster_edit-backup-policy.md) - Edit backup policy
* [kbcli cluster edit-config](kbcli_cluster_edit-config.md) - Edit the config file of the component.
* [kbcli cluster explain-config](kbcli_cluster_explain-config.md) - List the constraint for supported configuration params.
* [kbcli cluster expose](kbcli_cluster_expose.md) - Expose a cluster with a new endpoint, the new endpoint can be found by executing 'kbcli cluster describe NAME'.
* [kbcli cluster label](kbcli_cluster_label.md) - Update the labels on cluster
* [kbcli cluster list](kbcli_cluster_list.md) - List clusters.
* [kbcli cluster list-backup](kbcli_cluster_list-backup.md) - List backups.
* [kbcli cluster list-backup-policy](kbcli_cluster_list-backup-policy.md) - List backups policies.
* [kbcli cluster list-backups](kbcli_cluster_list-backups.md) - List backups.
* [kbcli cluster list-components](kbcli_cluster_list-components.md) - List cluster components.
* [kbcli cluster list-events](kbcli_cluster_list-events.md) - List cluster events.
* [kbcli cluster list-instances](kbcli_cluster_list-instances.md) - List cluster instances.
* [kbcli cluster list-logs](kbcli_cluster_list-logs.md) - List supported log files in cluster.
* [kbcli cluster list-ops](kbcli_cluster_list-ops.md) - List all opsRequests.
* [kbcli cluster list-restore](kbcli_cluster_list-restore.md) - List restores.
* [kbcli cluster logs](kbcli_cluster_logs.md) - Access cluster log file.
* [kbcli cluster promote](kbcli_cluster_promote.md) - Promote a non-primary or non-leader instance as the new primary or leader of the cluster
* [kbcli cluster rebuild-instance](kbcli_cluster_rebuild-instance.md) - Rebuild the specified instances in the cluster.
Expand Down
17 changes: 10 additions & 7 deletions docs/user_docs/cli/kbcli_cluster_backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ kbcli cluster backup NAME [flags]
### Options

```
--deletion-policy string Deletion policy for backup, determine whether the backup content in backup repo will be deleted after the backup is deleted, supported values: [Delete, Retain] (default "Delete")
-h, --help help for backup
--method string Backup methods are defined in backup policy (required), if only one backup method in backup policy, use it as default backup method, if multiple backup methods in backup policy, use method which volume snapshot is true as default backup method
--name string Backup name
--parent-backup string Parent backup name, used for incremental backup
--policy string Backup policy name, if not specified, use the cluster default backup policy
--retention-period string Retention period for backup, supported values: [1y, 1mo, 1d, 1h, 1m] or combine them [1y1mo1d1h1m], if not specified, the backup will not be automatically deleted, you need to manually delete it.
--deletion-policy string Deletion policy for backup, determine whether the backup content in backup repo will be deleted after the backup is deleted, supported values: [Delete, Retain] (default "Delete")
--dry-run string[="unchanged"] Must be "client", or "server". If with client strategy, only print the object that would be sent, and no data is actually sent. If with server strategy, submit the server-side request, but no data is persistent. (default "none")
--edit Edit the API resource before creating
-h, --help help for backup
--method string Backup methods are defined in backup policy (required), if only one backup method in backup policy, use it as default backup method, if multiple backup methods in backup policy, use method which volume snapshot is true as default backup method
--name string Backup name
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--parent-backup string Parent backup name, used for incremental backup
--policy string Backup policy name, if not specified, use the cluster default backup policy
--retention-period string Retention period for backup, supported values: [1y, 1mo, 1d, 1h, 1m] or combine them [1y1mo1d1h1m], if not specified, the backup will not be automatically deleted, you need to manually delete it.
```

### Options inherited from parent commands
Expand Down
1 change: 1 addition & 0 deletions docs/user_docs/cli/kbcli_cluster_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ kbcli cluster create [NAME] [flags]
* [kbcli cluster create elasticsearch](kbcli_cluster_create_elasticsearch.md) - Create a elasticsearch cluster.
* [kbcli cluster create kafka](kbcli_cluster_create_kafka.md) - Create a kafka cluster.
* [kbcli cluster create llm](kbcli_cluster_create_llm.md) - Create a llm cluster.
* [kbcli cluster create minio](kbcli_cluster_create_minio.md) - Create a minio cluster.
* [kbcli cluster create mongodb](kbcli_cluster_create_mongodb.md) - Create a mongodb cluster.
* [kbcli cluster create mysql](kbcli_cluster_create_mysql.md) - Create a mysql cluster.
* [kbcli cluster create postgresql](kbcli_cluster_create_postgresql.md) - Create a postgresql cluster.
Expand Down
5 changes: 5 additions & 0 deletions docs/user_docs/cli/kbcli_cluster_custom-ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ kbcli cluster custom-ops OpsDef --cluster <clusterName> <your custom params> [fl
### SEE ALSO

* [kbcli cluster](kbcli_cluster.md) - Cluster command.
* [kbcli cluster custom-ops etcd-defragmentation](kbcli_cluster_custom-ops_etcd-defragmentation.md) - Create a custom ops with opsDef etcd-defragmentation
* [kbcli cluster custom-ops kafka-quota](kbcli_cluster_custom-ops_kafka-quota.md) - Create a custom ops with opsDef kafka-quota
* [kbcli cluster custom-ops kafka-topic](kbcli_cluster_custom-ops_kafka-topic.md) - Create a custom ops with opsDef kafka-topic
* [kbcli cluster custom-ops kafka-user-acl](kbcli_cluster_custom-ops_kafka-user-acl.md) - Create a custom ops with opsDef kafka-user-acl
* [kbcli cluster custom-ops mysql-orc-switchover](kbcli_cluster_custom-ops_mysql-orc-switchover.md) - Create a custom ops with opsDef mysql-orc-switchover

#### Go Back to [CLI Overview](cli.md) Homepage.

4 changes: 2 additions & 2 deletions docs/user_docs/cli/kbcli_cluster_describe-backup-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ kbcli cluster describe-backup-policy [flags]
### Options

```
-h, --help help for describe-backup-policy
--name strings Backup policy name
-h, --help help for describe-backup-policy
--names strings Backup policy names
```

### Options inherited from parent commands
Expand Down
3 changes: 2 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_describe-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ kbcli cluster describe-backup BACKUP-NAME [flags]
### Options

```
-h, --help help for describe-backup
-h, --help help for describe-backup
--names strings Backup names
```

### Options inherited from parent commands
Expand Down
15 changes: 1 addition & 14 deletions docs/user_docs/cli/kbcli_cluster_edit-backup-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,12 @@ kbcli cluster edit-backup-policy
```
# edit backup policy
kbcli cluster edit-backup-policy <backup-policy-name>
# specify a backup repository
kbcli cluster edit-backup-policy <backup-policy-name> --set backupRepoName=<backup-repo-name>
# enable encryption
kbcli cluster edit-backup-policy <backup-policy-name> --set encryption.algorithm=AES-256-CFB --set encryption.passPhrase="SECRET!"
# disable encryption
kbcli cluster edit-backup-policy <backup-policy-name> --set encryption.disabled=true
# using short cmd to edit backup policy
kbcli cluster edit-bp <backup-policy-name>
```

### Options

```
-h, --help help for edit-backup-policy
--set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
-h, --help help for edit-backup-policy
```

### Options inherited from parent commands
Expand Down
13 changes: 7 additions & 6 deletions docs/user_docs/cli/kbcli_cluster_list-backup-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ kbcli cluster list-backup-policy [flags]
### Options

```
-A, --all-namespaces If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
-h, --help help for list-backup-policy
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml, wide (default table)
-l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.
--show-labels When printing, show all labels as the last column (default hide labels column)
-A, --all-namespaces If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
-h, --help help for list-backup-policy
--names strings The backup policy name to get the details.
-n, --namespace string specified the namespace
-o, --output format prints the output in the specified format. Allowed values: table, json, yaml, wide (default table)
-l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.
--show-labels When printing, show all labels as the last column (default hide labels column)
```

### Options inherited from parent commands
Expand All @@ -44,7 +46,6 @@ kbcli cluster list-backup-policy [flags]
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
--match-server-version Require server version to match client version
-n, --namespace string If present, the namespace scope for this CLI request
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
-s, --server string The address and port of the Kubernetes API server
--tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
Expand Down
Loading

0 comments on commit 3c42554

Please sign in to comment.