• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide
  4. Operation Guide
  5. App Manager
  6. Creating a Containerized Application

Creating a Containerized Application

A containerized application is created using either a component template or an application template.

Prerequisites

  • A container cluster has been created.
  • A component template or application template has been created.

Procedure

  1. In the navigation pane of the CCE console, choose App Manager. On the App Manager page, click Create Containerized App.

    NOTE:
    • To create a containerized application using a component template, go to 2.
    • To create a containerized application using an application template, go to 3.

  2. Create a containerized application using a component template.

    1. On the Create Containerized App page, select Component template as the template type.
      Figure 1 Create Containerized App page
    2. Select the container cluster name, and specify the containerized application name.
    3. Click Create Component.
      The Create Component dialog box is then displayed.
      Figure 2 Create Component page
    4. In the Create Component dialog box, specify component parameters.
      • Template Name

        Name of the component template you will use.

      • Component Name
        Name of the component to be created.
        NOTE:

        A component name must:

        • Be unique within a cluster and 1 to 24 characters long. Only lowercase letters, digits, and hyphens (-) are allowed.
        • Begin with a lowercase letter and but not end with a hyphen (-).
      • AZ
        • Automatic: An AZ is automatically selected for the application.
        • Custom: An AZ is selected for the application according to the AZ affinity and anti-affinity rules you created.

          Affinity: Affinity rules define in which AZs the application will be deployed. It is recommended that the AZs in which cluster nodes will be deployed should be selected as affinity AZs.

          AntiAffinity: Anti-affinity rules define in which AZs the application must not be deployed.

          If the affinity or anti-affinity rule is inappropriate, the CCE console displays a Warning dialog box "According to the selected affinity or anti-affinity rule, the application may not be scheduled onto any node. Are you sure you want to continue?" Click Cancel and correct the affinity or anti-affinity rule.

      • Node

        Node on which the component will run.

      • Instances

        Number of instances that the component has. Every instance is shipped as a container.

      • Service Name
        Service names serve a similar purpose as domain names. Components are addressed by their service names.
        NOTE:

        A service name must:

        • Be 1 to 24 characters long. Only lowercase letters, digits, and hyphens (-) are allowed.
        • Begin with a lowercase letter and but not end with a hyphen (-).
      • Public Service

        Indicates whether the component is accessible to external networks.

        If Yes is selected, the following parameters are displayed:

        • Service Type

          Indicates whether the component uses a NodePort or LoadBalancer.

        • Load Balancer
          Mandatory if Service Type is set to LoadBalancer.
          NOTE:

          If no load balancer is available for selection, return to the ELB console to create a new load balancer. For details, see (Optional) Creating a Load Balancer. After a new load balancer is created, it is displayed in the Load Balancer drop-down list.

        • Network Protocol

          Network protocol to be used by the component.

        • Container Port

          Listening port to be used by the component.

        • ELB Port

          Mandatory if Service Type is set to LoadBalancer.

          This parameter indicates the port used by the chosen load balancer to provide services externally. The port number ranges from 1 to 65535 (inclusive).

        • Node Port

          Mandatory if Service Type is set to NodePort.

          This parameter indicates the port used by the node to provide services externally. The port number is either automatically allocated or user-defined. The port number ranges from 30000 to 32767 (inclusive).
          NOTE:

          If Service Type is set to LoadBalancer, the node port must be different from the ports used by all the listeners of the ELB instance, to avoid the application creation failure caused by port conflicts.

    5. Click OK to complete component creation.

  3. Create a containerized application using an application template.

    1. On the Create Containerized App page, select App template as the template type.
      Figure 3 Creating a containerized application from an application template
      NOTE:

      Application templates are created using the graphic App Designer.

    2. Specify the container cluster name and containerized application name.

      If a containerized application is created from an application template, the application must be deployed on a container cluster in which all nodes have a public IP address. Otherwise, the application will be inaccessible to users.

    3. Select an application template from the App Template drop-down list.
    4. Click OK.

      The App Designer page then appears, displaying information about the created containerized application.

  4. Obtain the service address of the application.

    After the application is successfully created, you can access it from a browser.

    To obtain the application's service address, perform the following steps:

    1. Return to the App Manager page. On the application list, click Manage in the same row as the application.
    2. On the Components tab page, click the  icon next to any component of the application to show the component information. Click the Basic Info tab to view the application's service address.
      NOTE:
      • If the service type is NodePort, the service address is <Public IP address>:<Node port> of any node in the cluster. To view nodes' public IP addresses, go to the Nodes tab page on the Container Cluster page.
      • If the service type is LoadBalancer, the service address is <Load balancer IP address>:<ELB port>.
      • If the service type is ClusterIP, the application is only reachable from inside of the cluster and the service address is <Cluster IP address>:<Node port>.
      Figure 4 Viewing an application's service address