Deployments

更新时间:
复制 MD 格式

Deployments are stateless workloads, such as Nginx. In the LHC console, you can create, update, and delete deployments.

Note

Deployments are a native Kubernetes concept. For more information, see the official Kubernetes documentation.

Create a deployment

  1. Log on to the LHC console. In the navigation pane on the left, click Cluster Management > Clusters > Details. The cluster list page appears.

  2. Click the name of the destination cluster to go to the Cluster Details page, and then click the Workloads tab.

  3. In the navigation pane on the left, choose Deployments, and then click Create Deployment.

  4. In the dialog box that appears, enter the YAML content and click Submit.

    The following is a YAML sample:

     kind: Deployment
     metadata:
       name: deployment-example
       labels:
         k8s-app: deployment-example
     namespace: default
     spec:
       replicas: 1
       selector:
         matchLabels:
           k8s-app: deployment-example
       template:
         metadata:
           labels:
             k8s-app: deployment-example
         spec:
           containers:
    - name: nginx
             image: reg-cnsh.cloud.alipay.com/library/nginx:latest # Change this to the registry address for the current region.

Result

After the deployment is created, a deployment named deployment-example appears on the Deployments page.

Related operations

  • To view the details of a deployment, click its name on the Deployments page. The details page displays basic information, a list of pods, event information, and the YAML configuration.

  • To search for a deployment, enter a keyword from its name in the search box in the upper-right corner of the Deployments page.

  • To update a deployment, click View/Edit in the Actions column on the Deployments page. In the Edit Deployment dialog box, edit the YAML configuration, and then click Submit.

  • To delete a deployment, on the Deployments page, click the More icon in the Actions column and choose Delete. In the confirmation dialog box that appears, click OK.