Creating Chart and publish to the App Hub

This tutorial will guide you on how to create a Chart, create the Chart as a template in the App Hub, and finally publish and release it.

Scenario

Applications have been deployed and validated under the current project, and multiple applications as components of a given product need to be packaged into fixed versions for later deployment.That is, Configuring Chart will automatically package the container resources into Helm Chart format based on the application configuration selected in the task (For more details on Helm Chart format, refer to Helm Documentation_Charts),The values.yaml file in Chart is generated automatically by abstracting resource names, namespace, and other attributes into variables.

Main Steps

In this tutorial, you will.

  1. Create products associated with applications

  2. Create Chart in the pipeline

  3. Create templates through the App Hub

  4. Submit to the cluster where it needs to be published

Unit 1: Creating products associated with applications

In Unit 1, the creation of products and applications will be completed and applications will be associated to products.

Creating a New Product

Project leaders can create new products by following these steps.

  1. Log in to the EnOS Management Console and select Enterprise Container Platform in the left navigation menu.

  2. Select your organization from the Organization menu.

  3. Select the created project from the Project menu.

  4. Select Product from the left navigation, click New Product, enter the product name and description, and click Complete. This article is an example of creating a product of type Common.

    Note

    Chart only supports products of the Common type, and at least one application must be associated with the product.

    ../_images/new_product_1.png
  5. After creating the product, click Add > Create New Application in the Application module on the product details page to create an application associated with the changed product.

Creating an Application

The project leader for application development and deployment can create a new application by following the steps below, this article is an example of creating an application of type Normal.

  1. Enter the application name and select the application development language.

  2. Enter or select the application GitLab repository, and enter the path of the Git project. The repository can be left blank here, and be edited in application Basic Information after it is created.

  3. Enter description for the application and click Next Step.

    ../_images/create_app.png
  4. Select one or more application members and the member role, click Add Member, and click Next Step.

    ../_images/add_member.png
  5. Configure the detailed container deployment information for the application. Click Skip to skip the configuration if you want to configure the container information after the application is created. For details, see Managing Container Configuration.

Once the application is created, you can view its basic information by clicking on the application name in the application list.

Unit 2: Creating Chart in the Pipeline

In Unit 2, a new product pipeline will be created and run to create Chart. product level pipeline is used to package multiple applications under one product into one Chart for later deployment via Helm. Supported task types: Create Chart.

Configuring Pipeline Base Information

Create a new pipeline for the product by following the steps below.

  1. In the project list, click a project name to enter the project space.

  2. In the left navigation bar, select Development > Pipeline.

  3. Click New Pipeline and enter the basic configuration information in the Basic Information section.

    • App/Product: Select an application from the created applications list.

    • Pipline Name: Enter the name of the pipeline.

      ../_images/create_pipeline_product.png
  4. After completing the basic information configuration, go on to the Stage section to configure the stages and jobs of the pipeline.

Configuring the Stages and Jobs

Configure the stages and jobs of the pipeline by following the steps below.

  1. Enter the name for the stage at Stage Name.

  2. Click the Add Job button, select the job type, and enter the required parameters.

    • Create Chart

      • Cluster: Select the environment and cluster used by the pipeline.

      • Chart Name: Enter the Chart name, the default is the application/product name.

      • Chart Version:Enter Chart version number.

      • App Version: Enter the application version number.

  3. Click +SubChart to add a sub-Chart.

    • SubChart

      • App Name: Select the application associated with the product.

      • SubChart Name: Enter the application of the SubChart, the default is the application name.

      • SubChart Version: Enter the SubChart version number, the default is the Chart version number.

      • SubChart App Version Number: Enter the SubChart application version number, which defaults to the application version number.

    Note

    At least one SubChart must be included.

    ../_images/add_stage_chart.png
  4. You can click the +SubChart button and repeat the above steps to add multiple sub-charts.

  5. Once the configuration is complete, click the New Pipeline button to save the pipeline configuration.

  6. After returning to the Pipeline List screen, select Products and click on the pipeline created in the previous step.

  7. In the pipeline details page, click Run to run the pipeline.

  8. After running successfully, Chart is packaged successfully, click Create App Hub Template to create this Chart as an App Template.

    ../_images/create_apptemplate.png

Unit 3: Creating templates via the App Hub

In Unit 3, the created Chart will be created as an application template.

  1. Provide the following basic information.

    • Name: Enter the name of the application template.

    • Icon: Upload an icon for the application template.

    • Category: Select a category for the application template.

    • Developer:Required. Default username for current user.

    • Developer Organization:Required. Default current user Organization name.

    • Contact: Not required.

    • Introduction: Enter a short description for the application template.

    ../_images/app_template_basics.png
  2. Click Next Step and enter the version number and update instructions of the application template on the Version Information page.

    ../_images/app_template_version.png
  3. Click Next Step and in the Upload Chart page, select Local Directory or Image Repository to upload and click Complete to finish adding the application template.


After the application template is added, its initial state will be Developing by default.

Unit 4: Releasing to the cluster that needs to be published

In Unit 4, the created application template will be deployed.

  1. The existing versions of the template are listed in the Version section. Click the Submit icon, after selecting the cluster to be released in the pop-up window, click OK to Release the template version.

  2. The state will change to Released when the system administrator approves the application template.

  3. In the left navigation bar, select App Hub > Catalog.

  4. Use AppId to find an app template that is already on the shelf and click on it. View the details of the app template, select the version of the template you need to deploy, and click Deploy

    ../_images/deploying_app_instance.png
  5. Select the project, environment, and cluster for deploying the application instance, enter the name of the application, and click OK to complete the deployment of the application instance.

    ../_images/deploying_app_instance_1.png