Skip to content

Commit

Permalink
chore: remove sharding components (#322)
Browse files Browse the repository at this point in the history
Co-authored-by: wangyelei <[email protected]>
(cherry picked from commit 1687218)
  • Loading branch information
wangyelei committed Apr 26, 2024
1 parent 21a4bef commit 6bebc11
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 119 deletions.
1 change: 0 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ kbcli cluster configure NAME --set key=value[,key=value] [--components=component
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--replace Boolean flag to enable replacing config file. Default with false.
--set strings Specify parameters list to be updated. For more details, refer to 'kbcli cluster describe-config'.
--shardings strings sharding names to this operations
--ttlSecondsAfterSucceed int Time to live after the OpsRequest succeed
```

Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/cli/kbcli_cluster_create_llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kbcli cluster create llm NAME [flags]
--host-network-accessible Specify whether the cluster can be accessed from within the VPC.
--memory float Memory, the unit is Gi. Value range [0, 1000].
--model string Model name (default "facebook/opt-125m")
--monitoring-interval int The monitoring interval of cluster, 0 is disabled, the unit is second. Value range [0, 60].
--monitor-enabled Enable or disable monitor.
--publicly-accessible Specify whether the cluster can be accessed from the public internet.
--quantize string Model's quantized file name, only work for CPU mode
--rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources.
Expand Down
3 changes: 2 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_create_mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ kbcli cluster create mongodb NAME [flags]
--host-network-accessible Specify whether the cluster can be accessed from within the VPC.
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
--mode string Cluster topology mode. Legal values [standalone, replicaset]. (default "standalone")
--monitoring-interval int The monitoring interval of cluster, 0 is disabled, the unit is second. Value range [0, 60].
--monitor-enabled Enable or disable monitor.
--publicly-accessible Specify whether the cluster can be accessed from the public internet.
--rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources.
--replicas int The number of replicas, for standalone mode, the replicas is 1, for replicaset mode, the default replicas is 3. Value range [1, 5]. (default 1)
--storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20)
--storage-class-name string Storage class name of the data volume
--tenancy string The tenancy of cluster. Legal values [SharedNode, DedicatedNode]. (default "SharedNode")
--termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Halt, Delete, WipeOut]. (default "Delete")
--version string Cluster version.
Expand Down
3 changes: 2 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_create_mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ kbcli cluster create mysql NAME [flags]
--host-network-accessible Specify whether the cluster can be accessed from within the VPC.
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
--mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone")
--monitoring-interval int The monitoring interval of cluster, 0 is disabled, the unit is second. Value range [0, 60].
--monitor-enabled Enable or disable monitor.
--proxy-enabled Enable proxy or not.
--publicly-accessible Specify whether the cluster can be accessed from the public internet.
--rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources.
--replicas int The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Value range [1, 5]. (default 1)
--storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20)
--storage-class-name string Storage class name of the data volume
--tenancy string The tenancy of cluster. Legal values [SharedNode, DedicatedNode]. (default "SharedNode")
--termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Halt, Delete, WipeOut]. (default "Delete")
--version string Cluster version.
Expand Down
3 changes: 2 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_create_postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ kbcli cluster create postgresql NAME [flags]
--host-network-accessible Specify whether the cluster can be accessed from within the VPC.
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
--mode string Cluster topology mode. Legal values [standalone, replication]. (default "standalone")
--monitoring-interval int The monitoring interval of cluster, 0 is disabled, the unit is second. Value range [0, 60].
--monitor-enabled Enable or disable monitor.
--publicly-accessible Specify whether the cluster can be accessed from the public internet.
--rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources.
--replicas int The number of replicas, for standalone mode, the replicas is 1, for replication mode, the default replicas is 2. Value range [1, 5]. (default 1)
--storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20)
--storage-class-name string Storage class name of the data volume
--tenancy string The tenancy of cluster. Legal values [SharedNode, DedicatedNode]. (default "SharedNode")
--termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Halt, Delete, WipeOut]. (default "Delete")
--version string Cluster version.
Expand Down
5 changes: 3 additions & 2 deletions docs/user_docs/cli/kbcli_cluster_create_redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ kbcli cluster create redis NAME [flags]
-h, --help help for redis
--host-network-accessible Specify whether the cluster can be accessed from within the VPC.
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
--mode string Cluster topology mode. Legal values [standalone, replication, cluster]. (default "replication")
--monitoring-interval int The monitoring interval of cluster, 0 is disabled, the unit is second. Value range [0, 60].
--mode string Cluster topology mode. Legal values [standalone, replication, cluster, sentinel]. (default "replication")
--monitor-enabled Enable or disable monitor.
--node-port-enabled Whether NodePort service is enabled, default is true
--publicly-accessible Specify whether the cluster can be accessed from the public internet.
--rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources.
Expand All @@ -39,6 +39,7 @@ kbcli cluster create redis NAME [flags]
--sentinel.replicas float Sentinel component replicas Value range [1, 5]. (default 3)
--sentinel.storage float Sentinel component storage size, the unit is Gi. Value range [1, 1024]. (default 20)
--storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20)
--storage-class-name string Storage class name of the data volume
--tenancy string The tenancy of cluster. Legal values [SharedNode, DedicatedNode]. (default "SharedNode")
--termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Halt, Delete, WipeOut]. (default "Delete")
--twemproxy.cpu float twemproxy component cpu cores. Value range [0.1, 8]. (default 0.2)
Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/cli/kbcli_cluster_create_xinference.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ kbcli cluster create xinference NAME [flags]
-h, --help help for xinference
--host-network-accessible Specify whether the cluster can be accessed from within the VPC.
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 6)
--monitoring-interval int The monitoring interval of cluster, 0 is disabled, the unit is second. Value range [0, 60].
--monitor-enabled Enable or disable monitor.
--publicly-accessible Specify whether the cluster can be accessed from the public internet.
--rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources.
--replicas int The number of replicas, for standalone mode, the replicas is 1, for replication mode, the default replicas is 2. Value range [1, 5]. (default 1)
Expand Down
1 change: 0 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_edit-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ kbcli cluster edit-config NAME [--component=component-name] [--config-spec=confi
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--replace Boolean flag to enable replacing config file. Default with false.
--set strings Specify parameters list to be updated. For more details, refer to 'kbcli cluster describe-config'.
--shardings strings sharding names to this operations
--ttlSecondsAfterSucceed int Time to live after the OpsRequest succeed
```

Expand Down
1 change: 0 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_expose.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ kbcli cluster expose NAME --enable=[true|false] --type=[vpc|internet] [flags]
-h, --help help for expose
--name string OpsRequest name. if not specified, it will be randomly generated
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--shardings strings sharding names to this operations
--ttlSecondsAfterSucceed int Time to live after the OpsRequest succeed
--type string Expose type, currently supported types are 'vpc', 'internet'
```
Expand Down
1 change: 0 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_hscale.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ kbcli cluster hscale NAME [flags]
--name string OpsRequest name. if not specified, it will be randomly generated
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--replicas int Replicas with the specified components
--shardings strings sharding names to this operations
--ttlSecondsAfterSucceed int Time to live after the OpsRequest succeed
```

Expand Down
1 change: 0 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_restart.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ kbcli cluster restart NAME [flags]
-h, --help help for restart
--name string OpsRequest name. if not specified, it will be randomly generated
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--shardings strings sharding names to this operations
--ttlSecondsAfterSucceed int Time to live after the OpsRequest succeed
```

Expand Down
1 change: 0 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_volume-expand.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ kbcli cluster volume-expand NAME [flags]
-h, --help help for volume-expand
--name string OpsRequest name. if not specified, it will be randomly generated
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--shardings strings sharding names to this operations
--storage string Volume storage size (required)
--ttlSecondsAfterSucceed int Time to live after the OpsRequest succeed
-t, --volume-claim-templates strings VolumeClaimTemplate names in components (required)
Expand Down
1 change: 0 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_vscale.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ kbcli cluster vscale NAME [flags]
--memory string Request and limit size of component memory
--name string OpsRequest name. if not specified, it will be randomly generated
-o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml)
--shardings strings sharding names to this operations
--ttlSecondsAfterSucceed int Time to live after the OpsRequest succeed
```

Expand Down
90 changes: 6 additions & 84 deletions pkg/action/template/cluster_operations_template.cue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ options: {
component: string
instance: string
componentNames: [...string]
shardingNames: [...string]
rebuildInstanceFrom: [
...{
componentName: string
Expand Down Expand Up @@ -111,35 +110,18 @@ content: {
name: vctName
storage: options.storage
}]
},
for _, sName in options.shardingNames {
componentName: sName
isSharding: true
volumeClaimTemplates: [ for _, vctName in options.vctNames {
name: vctName
storage: options.storage
}]
}]
}]
}
if options.type == "HorizontalScaling" {
horizontalScaling: [ for _, cName in options.componentNames {
componentName: cName
replicas: options.replicas
},
for _, sName in options.shardingNames {
componentName: sName
isSharding: true
replicas: options.replicas
}]
}]
}
if options.type == "Restart" {
restart: [ for _, cName in options.componentNames {
componentName: cName
},
for _, sName in options.shardingNames {
componentName: sName
isSharding: true
}]
}]
}
if options.type == "VerticalScaling" {
verticalScaling: [ for _, cName in options.componentNames {
Expand All @@ -160,27 +142,7 @@ content: {
cpu: options.cpu
}
}
},
for _, sName in options.shardingNames {
componentName: sName
isSharding: true
requests: {
if options.memory != "" {
memory: options.memory
}
if options.cpu != "" {
cpu: options.cpu
}
}
limits: {
if options.memory != "" {
memory: options.memory
}
if options.cpu != "" {
cpu: options.cpu
}
}
}]
}]
}
if options.type == "Reconfiguring" {
if len(options.componentNames) == 1 {
Expand Down Expand Up @@ -227,29 +189,7 @@ content: {
}
}]
}]
},
for _, sName in options.shardingNames {
componentName: sName
isSharding: true
configurations: [ {
name: options.cfgTemplateName
if options.forceRestart {
policy: "simple"
}
keys: [{
key: options.cfgFile
if options.fileContent != "" {
fileContent: options.fileContent
}
if options.hasPatch {
parameters: [ for k, v in options.keyValues {
key: k
value: v
}]
}
}]
}]
}]
}]
}
}
if options.type == "Expose" {
Expand All @@ -269,25 +209,7 @@ content: {
}

}]
},
for _, sName in options.shardingNames {
componentName: sName
isSharding: true
if options.exposeEnabled == "true" {
switch: "Enable"
}
if options.exposeEnabled == "false" {
switch: "Disable"
}
services: [ for _, svc in options.services {
name: svc.name
serviceType: svc.serviceType
if len(svc.annotations) > 0 {
annotations: svc.annotations
}

}]
}]
}]
}
if options.type == "Switchover" {
switchover: [{
Expand Down
Loading

0 comments on commit 6bebc11

Please sign in to comment.