This topic describes how to modify the resource specifications (also known as unit config) and pools of a tenant by using ob-operator.
You can modify tenant resource specifications and resource pools to scale in or out a tenant.
Modify resource specifications
You can increase or decrease the CPU, memory, and log disk capacities to modify the resource specifications.
For more information about how to modify resource specifications, see Modify resource specifications.
Procedure
To modify the resource specifications of a zone, apply the parameters in the resource section of the zone in the tenant configuration file tenant.yaml. The procedure is as follows:
Modify the tenant configuration file
tenant.yaml.# For example, the value of minCPU is 2 before the modification. resource: maxCPU: 2500m memorySize: 1Gi # Optional -****************** minCPU: 2 maxIops: 1024 minIops: 1024 # v3 maxDiskSize: 3Gi maxSessionNum: 512 # v4 iopsWeight: logDiskSize: # The value of minCPU is changed to 1. resource: maxCPU: 2500m memorySize: 1Gi # Optional minCPU: 1 #2 -> 1 maxIops: 1024 minIops: 1024 # v3 maxDiskSize: 3Gi maxSessionNum: 512 # v4 iopsWeight: logDiskSize:Run the following command for the modification to take effect:
kubectl apply -f tenant.yamlRun the following command to view the custom resource of the tenant in the current Kubernetes cluster to determine whether the modification is successful:
kubectl get tenant -A -o yamlIf the value of the corresponding parameter in the
Status:resourcesection in the custom resource of the tenant is changed to the new value, the modification is successful.status: ... topology: - priority: 2 resource: logDiskSize: "3221225472" maxCPU: 2500m maxDiskSize: "0" maxIops: 1024 memorySize: "1073741824" minCPU: "1" minIops: 1024 type: name: FULL replica: 1 unitNum: 1 units: - migrate: serverIP: "" serverPort: 0 serverIP: xxx.xxx.xxx.xxx serverPort: 2882 status: ACTIVE unitId: 1001 zone: zone1
Change the number of resource units for a resource pool
Before you increase the resource units for a resource pool, make sure that the zone has sufficient OBServer nodes. For more information about how to add OBServer nodes to a zone, see Add OBServer nodes to zones.
Procedure
When you modify the number of resource units for a resource pool, apply the unitNum parameter of each zone in the topology section in the tenant configuration file tenant.yaml. Take the following steps:
Modify the tenant configuration file
tenant.yaml.#For example, increase the number of resource units to 2 for zone1. topology: - zone: zone1 unitNum: 1 # The value of unitNum is changed to 2. topology: - zone: zone1 unitNum: 2 #1 -> 2Run the following command for the modification to take effect:
kubectl apply -f tenant.yamlRun the following command to view the custom resource of the tenant in the current Kubernetes cluster to determine whether the modification is successful:
kubectl get tenant -A -o yamlIf the value of the corresponding parameter in the
Status:resourcesection in the custom resource of the tenant is changed to the new value, the modification is successful.status: ... unitNum: 2 units: - migrate: serverIP: "" serverPort: 0 serverIP: xxx.xxx.xxx.xxx serverPort: 2882 status: ACTIVE unitId: 1001 zone: zone1