By default, an ordinary TKE cluster will automatically schedule a Pod to a pay-as-you-go supernodes after a node pool of the pay-as-you-go supernodes type is added to it when node resources are insufficient. An serverless cluster will automatically schedule Pod randomly at multiple pay-as-you-go supernodes.
If you do not want to schedule a Pod to some pay-as-you-go supernodes (which represents a certain subnet/availability zone), you can cordon the pay-as-you-go supernodes in the following two ways:
$kubectl cordon $pay-as-you-go supernodes name
You need to create a configmap called “eks-config” in the kube-system namespace by running the following command:
$kubectl create configmap eks-config --from-literal=AUTO_SCALE_EKS=false
Specify the value of AUTO_SCALE_EKS
as false
, and you can disable the automatic scheduling mechanism to prohibit ordinary TKE clusters from automatically scheduling a Pod to a pay-as-you-go supernodes.
By default, a pay-as-you-go supernodes automatically adds taints to lower the scheduling priority. If you want to manually schedule a Pod to a (specified) pay-as-you-go supernodes, you need to add corresponding tolerations for the Pod. However, not all the Pods can be scheduled to pay-as-you-go supernodes. For more information, see Notes for Scheduling Pod to Supernodes. For the sake of convenience, you can specify nodeselector
in Pod Spec, as shown below;
spec:
nodeSelector:
node.kubernetes.io/instance-type: eklet
TKE’s control components will judge whether the Pod can be scheduled to a pay-as-you-go supernodes. If not, the Pod will not be scheduled to the pay-as-you-go supernodes.
Note:If you forcibly schedule a Pod to a pay-as-you-go supernodes, the Pod may fail to be created. For information on the cause of he failure, see How do I manually schedule a Pod to a pay-as-you-go supernodes?.
If you need to forcibly schedule a Pod to a pay-as-you-go supernodes, you not only need to specify nodeselector
or nodename
for the Pod but also add corresponding tolerations.
Specify nodeselector
in Pod Spec, as shown below:
spec:
nodeSelector:
node.kubernetes.io/instance-type: eklet
Or specify nodename
in Pod Spec, as shown below:
spec:
nodeName: $pay-as-you-go supernodes name
spec:
tolerations:
- effect: NoSchedule
key: eks.tke.cloud.tencent.com/eklet
operator: Exists
Serverless cluster supports pay-as-you-go supernodes. You can specify annotations in a YAML file to implement capabilities such as custom DNS. For more information, see Pay-as-you-go Supernodes Annotation Description.
Apakah halaman ini membantu?