edit-icon download-icon

Create a config map

Last Updated: Apr 25, 2018

In the Container Service console, you can create a config map on the Config Maps page or by using a template.

Create a config map on Config Maps page

  1. Log on to the Container Service console.

  2. Click Kubernetes > Application > Config Maps in the left-side navigation pane.

  3. Select the cluster from the Cluster drop-down list.

  4. Click Create in the upper-right corner.

    1

  5. Complete the settings and then click OK.

    • Namespace: Select the namespace to which the config map belongs. The config map is a Kubernetes resource object and must act on a namespace.

    • Config Map Name: Enter the config map name, which can contain lowercase letters, numbers, hyphens (-), and periods (.). The name cannot be empty. Other resource objects must reference the config map name to obtain the configuration information.

    • Configuration: Enter the Variable Name and the Variable Value. Then, click Add on the right. You can also click Edit YAML file to set the configurations in the displayed dialog box, and then click OK.

    1

    In this example, configure the variables enemies and lives to pass the parameters aliens and 3 respectively.

    1

  6. You can view the config map test-config on the Config Maps page after clicking OK.

    1

Create a config map by using a template

  1. Log on to the Container Service console.

  2. Click Kubernetes > Application > Deployment in the left-side navigation pane.

  3. Click Create by template in the upper-right corner.

    1

  4. On the Deploy templates page, complete the settings and then click DEPLOY.

    • Clusters: Select the cluster in which the config map is to be created.

    • Namespace: Select the namespace to which the config map belongs. The config map is a Kubernetes resource object and must act on a namespace.

    • Resource Type: You can write your own config map based on the Kubernetes YAML syntax rules, or select the sample template Resource - ConfigMap. In the sample template, the config map is named as aliyun-config and includes two variable files game.properties and ui.properties. You can make modifications based on the sample template. Then, click DEPLOY.

    1

  5. After the successful deployment, you can view the config map aliyun-config on the Config Maps page.

    1

Thank you! We've received your feedback.