You need to enable JavaScript to run this app.
Code Pipeline

Code Pipeline

Copy page
Download PDF
K8s YAML
Use placeholders and variables
Copy page
Download PDF
Use placeholders and variables
The system provides system image placeholders, preset placeholders, and custom placeholders to help you quickly orchestrate applications. This article introduces features related to placeholders and explains how to use placeholders and variables.​
Background information​
  • Image placeholder​
  • Users can dynamically specify the target image address at runtime, making it easier to upgrade application images, perform differentiated deployment across multiple environments, and address other similar scenarios.​
  • ​
    Name​
    Type​
    Description​
    Notes​
    image.[custom name]​
    String​
    Enter remarks such as the purpose of the image and other relevant information. This field can be left blank.​
    • Click Add to add a new image placeholder. Supports customizing the names and descriptions of image placeholders.​
    • Click {{ .AppDeliver.image.[custom name] }} in the YAML edit area to reference the current image placeholder.​
    • By default, the system provides a placeholder image named image.backend for the Deployment resource. Modification and deletion are supported.​
    ​
  • Preset placeholder​
  • A preset placeholder is a system-defined placeholder. The value of a preset placeholder cannot be modified.​
  • ​
    Name​
    Type​
    Value source​
    Value​
    Notes​
    appName​
    String​
    Variable​
    AppName​
    • appName is a system-defined placeholder for the Application ID, which helps you quickly distinguish applications. The parameter "AppName" is a preset parameter that represents the Application ID of the current application and cannot be modified.​
    • In the YAML edit area, click or tap {{ .AppDeliver.appName }}; you can then reference the current predefined placeholder.​
    envName​
    String​
    Variable​
    EnvName​
    • envName is a system-preset Environment ID placeholder that helps you quickly distinguish the environment in which an application is deployed. EnvName is a predefined parameter that represents the Environment ID of the current application and cannot be modified.​
    • In the YAML edit area, type {{ .AppDeliver.envName }} to reference the predefined placeholder.​
    ​
  • Custom placeholders​
  • Custom placeholders are placeholders set by the user. A value source can be a variable (system preset parameter, custom parameter) or a constant. By using custom placeholders together with variables, you can achieve differentiated deployment of application orchestration across different environments.​
  • The system provides commonly used custom placeholders by default, such as namespace, port, and replicas, and has already preset recommended default values. You can add, modify, or delete custom placeholders as needed.​
Prerequisites​
  • The environment has been created. This example creates development environment 1 and test environment 1.​
  • The variables have already been created in advance. This example creates the custom parameter Label.​
Procedure​
The following takes adding a custom placeholder label to enable different Deployment labels for development and test environments as an example:​
  1. Log in to the current application.​
  1. Log in to Code Pipeline console.​
  1. Select workspace in the left navigation bar.​
  1. Click the target workspace name to enter the selected workspace.​
  1. Select Application Delivery > Application Management in the left navigation bar.​
  1. Click the target application card to open the selected application.​
  1. Click Application Orchestration. Switch to the Application Orchestration tab.​
  1. Click edit to enter the application orchestration page.​
  1. In the YAML editing area, enter run: "{{ .Values.label }} " below the metadata.labels.run parameter.​
  1. Click Extract placeholder, and the custom placeholder area on the right will display the newly added custom placeholder label.​
  1. Set the information for the custom placeholder label.​
  • ​
    Configuration Item​
    Descriptions​
    Name​
    Display the names of extracted custom placeholders. This example is a label.​
    warning​
    If you need to change the name, please be sure to also modify the custom placeholder name in the YAML edit area at the same time. This example selects a variable.​
    Type​
    Select the type of the current placeholder as needed; the default is string. Supports string, integer, floating-point number, and Boolean value.​
    tip​
    When selecting a variable as the value source, the type remains the default.​
    Value source​
    Supports constants and variables. Variables are used to enable differentiated deployment across different environments. This example selects variables.​
    Value​
    Enter the value of the parameter. This example uses the custom configuration parameter Label that was created in advance.​
    • When the value source is set to constant, simply enter the value of the corresponding type.​
    • When the value source is set to variable, you can use either preset parameters or custom parameters that you create.​
    ​
  1. Click Confirm, and set the active environment in the pop-up dialog box. In this example, development environment 1 and test environment 1, which were created in advance, are selected.​
  1. After completing the settings, click Create.​
What to do next​
Enable the custom configuration parameter Label in development environment 1 and assign it the value aaa, and in test environment 1 and assign it the value bbb. In other words, this is a set of configurations, each arranged in a different environment with distinct Deployment labels. When deploying development environment 1, assign aaa to label; when deploying test environment 1, assign bbb to label.​
​
Last updated: 2025.09.10 17:37:26