Updated on 2024-09-05 GMT+08:00

ConfigMaps

ConfigMaps store configuration details required for workloads. ConfigMaps decouple configuration files from container images to enhance workload portability.

ConfigMaps allow you to:

  • Manage configurations for different environments and services.
  • Deploy workloads in different environments. Multiple versions are supported for configuration files so that you can update and roll back workloads easily.
  • Quickly import configurations in the form of files to containers.

Creating a ConfigMap

  1. Log in to the IEF console, and click Switch Instance on the Dashboard page to select a platinum service instance.
  2. In the navigation pane, choose Edge Applications > Application Configuration. Then, click Create ConfigMap in the upper right corner.
  3. Specify the ConfigMap details.

    Figure 1 Creating a ConfigMap
    • Name: Enter a ConfigMap name.
    • Data: The configuration data is key-value pairs. Enter a property name and value.

  4. Click Create. After the ConfigMap is created, the ConfigMap list page is displayed.

Using a ConfigMap

You can use ConfigMaps to configure data storage in the advanced settings when creating a containerized application.

Figure 2 Using a ConfigMap

After the ConfigMap is mounted to the container, files are created in the mount directory based on the ConfigMap content. Each property name and value pair is generated as a file. The property name is the file name, and the value is the content of the file. For instance, a ConfigMap could have the property name set to key and the property value set to value. After the ConfigMap is mounted to the /tmp0 directory, a file named key is generated in the /tmp0 directory and the file content is value.