In some cases, you may need to deploy a management service on a master node to meet your business requirements. You may also need to deploy your services on nodes that use standard SSDs. This topic describes how to schedule a pod to a specific node in the Container Service for Kubernetes (ACK) console. You can configure node labels or pod templates to schedule pods to specific nodes.

Background information

You can configure node labels and set nodeSelector to schedule a pod to a specific node. For more information about how to set nodeSelector, see nodeSelector.

Step 1: Configure node labels

  1. Log on to the ACK console.
  2. In the left-side navigation pane, click Clusters.
  3. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane of the details page, choose Nodes > Node.
  5. Select the cluster that you want to manage, and click Manage Labels and Taints in the upper-right corner of the page to go to the Manage Labels and Taints page.
  6. On the Labels tab, select the nodes that you want to manage and click Add Label.
  7. In the Add dialog box, specify Name and Value, and then click OK.
    • Name: the name of the label. The name can contain letters, digits, hyphens (-), underscores (_), and periods (.).It must start and end with a letter or a digit.
    • Value: the value of the label. The value can contain letters, digits, hyphens (-), underscores (_), and periods (.). You can leave this parameter empty.If the value is not empty, it must start and end with a letter or a digit.

Step 2: Schedule a pod to a specific node

  1. In the left-side navigation pane, click Clusters.
  2. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  3. In the left-side navigation pane of the details page, choose Workloads > Deployments.
  4. On the Deployments page, click Create from Template in the upper-right corner of the page.
  5. Configure the template.
    • Namespace: Select the namespace to which the pod belongs. In this example, the default namespace is selected.
    • Sample Template: In this example, Custom is selected.

    The following template is an example:

     apiVersion: v1 kind: Pod metadata: labels: name: hello-pod name: hello-pod spec: containers: - image: nginx imagePullPolicy: IfNotPresent name: hello-pod ports: - containerPort: 8080 protocol: TCP resources: {} securityContext: capabilities: {} privileged: false terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always nodeSelector:  group: worker ## This value must be the same as the node label that is added in Step 1. status: {}
  6. Click Create. A message that indicates the deployment status appears.

Verify the result

You can use one of the following methods to check whether the pod has been deployed to the node with specified label.

Method 1: Click the pod name after the pod is deployed

  1. After the pod is deployed, click the pod name in the notification at the bottom of the page to go to the Pods page.
    Create pods
  2. On the Pods page, click the pod name to go to the details page of the pod.
    On the details page, if you can view the pod labels and the ID of the node that hosts the pod, it indicates that the pod is scheduled to the node with the group:worker label. Check pod details

Method 2: Check the containers on the Pods page

  1. In the left-side navigation pane, click Clusters.
  2. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  3. In the left-side navigation pane of the details page, choose Workloads > Pods.
  4. On the Pods page, click the pod name to go to the details page of the pod.