By Xining Wang
The Alibaba Cloud Service Mesh (ASM) serverless gateway is built on virtual nodes and Elastic Container Instance. It applies to scenarios that require elastic resources and do not require node maintenance.
virtual-kubelet.io/provider=alibabacloud:NoScheduletaint. This prevents accidental usage of elastic container instances.
tolerations: - key: virtual-kubelet.io/provider operator: Equal value: alibabacloud effect: NoSchedule
• If you create an ASM gateway in a Serverless Kubernetes (ASK) cluster in the ASM console, the pods run on elastic container instances, and you do not need to perform the operations described in this article.
• The following procedure applies to an ACK cluster (an ACK standard cluster, an ACK Pro cluster, or an ACK dedicated cluster). You must deploy the ack-virtual-node component. For more information, see Deploy ack-virtual-node component.
Run kubectl get nodes to obtain the names of the nodes in the specific cluster. Select a node to which you want to add a label and execute the kubectl label nodes = command to add the label to the desired node.
kubectl label nodes node1 mykey4pod=asmgateway
Run kubectl taint to add a taint to the node. For example,
kubectl taint nodes node1 mykey=myvalue:NoSchedule
This command adds a taint to node 1. The key is mykey, the value is myvalue, and the effect is NoSchedule. This way, only pods that tolerate the taint can be scheduled to node 1.
Configure the nodeAffinity parameters of the ASM gateway so that the pods of the ASM gateway are scheduled to the corresponding nodes.
Configure the tolerations parameters to match the taint created in Step 2. As such, the pods of the ASM gateway can be scheduled to node 1.
affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - preference: matchExpressions: - key: type operator: In values: - virtual-kubelet weight: 20 - preference: matchExpressions: - key: mykey4pod operator: In values: - asmgateway weight: 80 requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: mykey4pod operator: In values: - asmgateway - matchExpressions: - key: type operator: In values: - virtual-kubelet tolerations: - effect: NoSchedule key: virtual-kubelet.io/provider operator: Equal value: alibabacloud - effect: NoSchedule key: mykey operator: Equal value: myvalue
preferredDuringSchedulingIgnoredDuringExecutionparameter is associated with two
matchExpressionsfields. When using the configuration with a weight of 20, pods are scheduled to use elastic container instances. When using the configuration with a weight of 80, pods are scheduled to ECS nodes with the specified label. Additionally, the weight values are relative, and a configuration with a higher value is preferred.
requiredDuringSchedulingIgnoredDuringExecutionparameter is associated with two
matchExpressionsfields. One indicates that pods are scheduled to ECS nodes with the specified label, and the other indicates that pods are scheduled to use elastic container instances.
virtual-kubelet.io/provider=alibabacloud:NoScheduletaint and can use elastic container instances.
Alibaba Cloud Native Community - September 20, 2023
Xi Ning Wang(王夕宁) - August 7, 2023
Alibaba Clouder - July 15, 2020
Xi Ning Wang(王夕宁) - August 7, 2023
Xi Ning Wang(王夕宁) - July 21, 2023
Alibaba Clouder - April 26, 2021
Alibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.Learn More
Accelerate and secure the development, deployment, and management of containerized applications cost-effectively.Learn More
Multi-source metrics are aggregated to monitor the status of your business and services in real time.Learn More
Visualization, O&M-free orchestration, and Coordination of Stateful Application ScenariosLearn More
More Posts by Xi Ning Wang(王夕宁)