Baidu AI Cloud
中国站

百度智能云

Cloud Container Engine

Quick Deployment of Unitized Application

This document describes how to use Baidu AI Cloud Container Engine for Edge to deploy a unitized web application quickly.

The sample practice in this paper takes Nginx as the web application and avails services at every edge site through service access groups.

This document illustrates the using process of the Baidu AI Cloud Edge Cluster with simple and visual charts and graphs for you to understand and quickly get started. There are three major application steps as follows:

Step 1: Create an edge node group;

Step 2: Create an application deployment group and deploy unitized applications;

Step 3: Create a service access group;

Create Edge Node Group

  1. Click the name of the edge cluster to enter the cluster details page; then click "Unitized Deployment> Edge Node Group" to enter the edge node group page.

image.png

  1. Click the "Create Edge Node Group" button to enter the edge node group creation page.

image.png

  1. Enter the edge node group name “node-group-test”, check the edge node for web applications to deploy in the cluster edge node according to your service conditions. For example, to select two edge nodes, i.e., East China-Fuzhou (China Mobile-1) “cce-n4rkq18v-5u30wlkp”, East China-Hefei (China Mobile-1) “cce-n4rkq18v-91rh32zd”, click the “Finish” button.

Note: Different edge nodes in the cluster may belong to the same edge site. That is, there are multiple edge nodes in the same edge site. Then applications to be deployed in this edge node group “node-group-test” are deployed separately in the associated edge sites East China-Fuzhou (China Mobile-1) and East China-Hefei (China Mobile-1).

image.png

  1. Then, you can view the newly created edge node group “node-group-test” on the edge node group list page. Also, you can use the edge node group “node-group-test” to deploy web applications through the application deployment group later.

image.png

Create Application Deployment Group and Deploy Unitized Applications

  1. Click "Unitized Deployment > Application Deployment Group" to enter the application deployment group page.

image.png

  1. Click the button "Create Application Deployment Group" to enter the new application deployment group page and select " Create by Form" or " Create by Yaml ".
  1. Create a page by form:

image.png

  1. Create a page by Yaml:

image.png

  1. If you select "Create by form", enter the application deployment group name “web-test”, select the edge node group “node-group-test” created in the last step, the namespace “default” for the application to be deployed, and the workload "Deployment", and then enter the desired number of Pods.

image.png

Add the container configuration and enter the image address to select the Nginx container image (hub.baidubce.com/cce/nginx-alpine-go:latest).

image.png

After the container configuration is successful, click the "Create" button and confirm the generated Yaml to create it.

image.png

If you select " Create by Yaml", enter the following YAML file and modify configurations like the number of container groups as required. Then, click "OK" to create it.

image.png

kind: BatchDeployment
apiVersion: apps.cce.io/v1alpha1
metadata:
  name: web-test
  namespace: default
spec:
  deployGroup: node-group-test
  selectedStrategy: none
  workloadTemplate:
    deployment:
      replicas: 1
      selector:
        matchLabels:
          app: web-test
      template:
        metadata:
          labels:
            app: web-test
        spec:
          containers:
            - image: hub.baidubce.com/cce/nginx-alpine-go:latest
              name: web-test
              imagePullPolicy: Always
              ports:
                - containerPort: 80
                  name: web-test
  1. After the application creation is successful, you can see the created application deployment group “web-test” in the application deployment group list.

image.png

  1. Click the name of the application deployment group to enter the application deployment group profile page and view the basic information of the application deployment group, container configuration, and associated service access group.

image.png

Create Service Access Group

The service access group is associated with the application deployment group and provides service access capabilities for the workload created. The service created by the service access group is defaulted to support traffic topology. That is, edge node applications can only be accessed by nodes of the same node group and edge site.

  1. Click "Unitized Deployment> Service Access Group" to enter the service access group page.

image.png

  1. Click the button "Create Service Access Group", select the sample template ClusterIP and modify relevant configuration information, or enter the following YAML files and click Create to start creating the service access group ClusterIP.

Note: The selector in the YAML file should be associated with the web-test just created.

image.png

  1. You can view the created service access group “web-test-svc” in the service access group list.

image.png

  1. Then, you can only access the services in the respective edge sites with traffics of the service access group “web-test -svc” on the two edge nodes, i.e., East China-Fuzhou (China Mobile-1) and East China-Nanchang (China Mobile-1) in the node deployment group “node-group-test” associated with the service access group “web-test-svc”.
Previous
Introduction
Next
Service Access Group Management