Updated on 2023-10-30 GMT+08:00

Preparations

Preparing Resources

To facilitate subsequent operations, ensure that:

  1. You have created a Virtual Private Cloud (VPC). For details, see Creating a VPC.
  2. You have created an exclusive microservice engine with security authentication disabled. For details, see Creating a Microservice Engine.
    • The VPC to which the microservice engine belongs is the one created in 1. If the VPCs are inconsistent, correctly configure the VPC connectivity.
    • If you have enabled the enterprise project function, the microservice engine and its VPC must be in the same enterprise project.
  3. You have created a Cloud Container Engine (CCE) cluster. In a trial scenario, set Management Scale to 50 nodes and HA to No.

    The cluster contains at least one ECS node with 8 vCPUs and 16 GB memory or two ECS nodes with 4 vCPUs and 8 GB memory, and is bound to an EIP. For details, see Buying a Cluster.

    • The VPC to which the CCE cluster belongs is the one created in 1.
    • If you have enabled the enterprise project function, the CCE cluster and its VPC must be in the same enterprise project.
    • The CCE cluster cannot be bound to other environments.
    • If a CCE cluster 1.23 or later is created, Container Engine of the ECS node in the cluster supports only Docker.
  4. In this example, the GitHub source code repository is bound to ServiceStage to implement source code building, archiving, and application creation. Ensure that you have registered an account on GitHub.

Forking the Weather Forecast Source Code

Use your account to log in to GitHub and fork the weather forecast source code. Source code address: https://github.com/servicestage-demo/weathermap.git

Setting GitHub Repository Authorization

You can set GitHub repository authorization so that build projects and application components can use the authorization information to access the GitHub source code repository.

  1. Log in to ServiceStage.
  2. Choose Continuous Delivery > Repository Authorization > Create Authorization and configure authorization information by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Name

    Use the default authorization name. This name cannot be changed after being created.

    *Repository Authorization

    1. Select GitHub.
    2. Select an authorization method.
      • OAuth: Click Use OAuth Authorization and complete the authorization creation as prompted.
      • Personal token: Enter the obtained private token and click Create.

  3. Click Create.

Creating an Organization

  1. Choose Deployment Source Management > Organization Management.
  2. Click Create Organization. On the displayed page, specify Organization Name. For example, org-test.
  3. Click OK.

    Figure 1 Creating an organization

Creating an Environment

  1. Choose Environment Management > Create Environment and set the environment information by referring to the following table.

    Parameter

    Description

    Environment

    Enter an environment name, for example, env-test.

    Enterprise Project

    Specify Enterprise Project.

    Enterprise projects let you manage cloud resources and users by project.

    It is available after you enable the enterprise project function. The environment and its VPC must be in the same enterprise project.

    Description

    Retain the default value.

    VPC

    Select the VPC prepared in Preparing Resources.

    NOTE:

    The VPC cannot be modified after the environment is created.

    Environment Type

    Select Kubernetes.

    Figure 2 Configuring an environment

  2. Click Create Now.
  3. In the Resource Settings area, choose Cloud Container Engine from Compute and click Bind now.
  4. In the dialog box that is displayed, select the CCE cluster created in Preparing Resources and click OK.
  5. In the Resource Settings area, choose Cloud Service Engine from Middleware and click Manage Resource.
  6. In the dialog box that is displayed, select the microservice engine created in Preparing Resources and click OK.

Creating an Application

  1. Click in the upper left corner to return to the Environment Management page.
  2. Choose Application Management > Create Application and set basic application information.

    1. Name: Enter weathermap.

      If an application with the same name already exists in the application list, rectify the fault by referring to What Should I Do If a Weather Forecast Application with the Same Name Exists in the Current Environment?.

    2. Enterprise Project: Enterprise projects let you manage cloud resources and users by project.

      It is available after you enable the enterprise project function. The application and the created environment must be in the same enterprise project.

  3. Click OK.

    Figure 3 Creating an application