The system may exhaust instances of specified types or vSwitch IP resources in a zone when it attempts to create sufficient instances to handle traffic spikes or process a large number of jobs in parallel. As a result, you fail to create Elastic Container Instances (ECIs) in the zone. In this case, you can deploy an ACK Serverless cluster across multiple zones to prevent resource shortage.
Background information
An ECI distributes the requests for creating pods to all vSwitches. This balances the heavy load.
If the zone of a vSwitch does not have sufficient resources to create the required pods, the system selects another vSwitch.
Modify the configuration of zones for a cluster
After the ACK Serverless cluster is created, modify the vSwitch configuration for the cluster. You do not need to recreate the cluster. Run the following command and modify the vswitch
field in kube-system/eci-profile configmap
based on your business requirements. The modification immediately takes effect.
kubectl -n kube-system edit cm eci-profile
apiVersion: v1
data:
kube-proxy: "true"
privatezone: "true"
quota-cpu: "192000"
quota-memory: 640Ti
quota-pods: "4000"
regionId: cn-hangzhou
resourcegroup: ""
securitygroupId: sg-xxx
vpcId: vpc-xxx
vswitchIds: vsw-xxx,vsw-yyy,vsw-zzz
kind: ConfigMap
FAQ
How do I add nodes to an ACK Serverless cluster?
The concept of node is not applied to ACK Serverless clusters. To deploy ECIs in other zones, you can add a vSwitch of another zone to the eci-profile ConfigMap of the kube-system namespace. Separate vSwitches with commas (,).
How do I deploy pods in different zones?
By default, pods are randomly scheduled to zones that have sufficient resources.
Match virtual kubelet. You can deploy ECIs of different instance types across zones by using the following three annotations:
- k8s.aliyun.com/eci-schedule-strategy: " VSwitchOrdered"
- k8s.aliyun.com/eci-vswitch: "vsw-11111, vsw-22222"
- k8s.aliyun.com/eci-use-specs: "ecs.c5.4xlarge, ecs.c6.4xlarge,2-4Gi"
VSwitchOrdered
specifies that ECIs are created based on the vSwitch list in thek8s.aliyun.com/eci-vswitch
annotation. You can setk8s.aliyun.com/eci-schedule-strategy
toVSwitchRandom
orVSwitchOrdered
. When you create an ECI, the ECI is randomly scheduled to a zone or scheduled based on the vSwitch list specified by thek8s.aliyun.com/eci-vswitch
annotation.