Manage pods

更新时间:
复制 MD 格式

Pods are the smallest deployable units in Kubernetes. A pod runs an instance of independent application in Kubernetes. The instance may consist of one or more containers that are tightly coupled. This topic describes how to view details and modify configurations of a pod and manually scale container applications in the Container Service for Kubernetes (ACK) console.

Prerequisites

A workload is created. For more information, see Workloads.

View pods

View details of a pod

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Workloads > Pods.

  3. On the Pods page, find the target pod and click Details in the Actions column.

    Note

    On the Pods page, you can modify and delete pods. For pods that are created by using a Deployment, we recommend that you use the Deployment to manage the pods.

    The following table describes the status of pods.

    Status

    Description

    Initialized

    All init containers are started.

    Ready

    The pod is able to serve requests and added to the load balancing pools of all matching services.

    ContainersReady

    All containers in the pod are ready.

    PodScheduled

    The pod has been scheduled to a node.

    For more information, see Pod Lifecycle.

View pod logs

On the Pods page, find the target pod and click Logs in the Actions column to view the logs of its containers.

Filter pods

On the Pods page, you can filter pods by name, label, pod IP address, and node IP address. To filter by a specific label, click the filter icon in the Label column header, enter the key and value for the label in the dialog box that appears, and then click OK.

Diagnose a pod

On the Pods page, find the pod that you want to diagnose and click Diagnose in the Actions column. For more information, see Use cluster diagnostics.

Modify the upper and lower limits of CPU and memory resources for a pod

After you create an application, you can modify the upper and lower limits of CPU and memory resources for the application pods based on your business requirements. In this example, a Deployment is used.

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Workloads > Deployments.

  3. On the Deployments page, select a namespace from the Namespace drop-down list. Find the target application and click Edit in the Actions column.

  4. On the application's edit page, set the CPU and memory requests and limits in the Limit and Required Resources sections based on your business needs. Then, click Update.

    Important

    The maximum number of pods that are supported by a cluster node is related to the network plug-in that is used by the cluster. For more information, see Compare Terway modes section of the "Work with Terway" topic.

Modify the configurations of a pod

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Workloads > Pods.

  3. On the Pods page, find the target pod and click Edit in the Actions column.

  4. Update the pod configuration and click Update.

Manually scale pods for an application

After an application is created, you can scale the pods that are provisioned for the application based on your business requirements.

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Workloads > Deployments.

  3. Select a namespace, find the Deployment that you want to manage, and click Scale in the Actions column.

  4. In the dialog box that appears, set the desired number of pods to 4 and click OK.

    Note

    By default, Deployments in Kubernetes are updated in rollingUpdate mode. This ensures that a minimum number of pods are available during the update. You can modify the minimum number of available containers in the template.

References