Loading ConfigMap Configuration

After the mounted ConfigMap is updated, the application needs to load the updated configuration to take effect. For applications that cannot automatically load the configuration, Load Configuration provides the ability to manually trigger the application to load the ConfigMap.

Prerequisites

  • The application must support hot configuration updates.

  • The ConfigMap must be mounted as a storage volume within the pod, and the SubPath cannot be used. ConfigMaps referenced through environment variables do not support loading configuration.

Steps

  1. Enter Container Platform.

  2. In the left navigation bar, click Configuration > ConfigMaps.

  3. Click on ConfigMap Name.

  4. Click Add Configuration Item or click Add Binary Configuration Item; you can also click expand Update Configuration Item and confirm. as needed.

  5. Switch to the Workloads tab and click expand Expand its container list..

  6. Click Load Configuration, enter the user and execute the command, and confirm. By default, it executes into the container as the root user.

  7. Enter the corresponding command to load the configuration based on the application type.

    • Example 1: Nginx

      nginx -s reload
    • Example 2: Logstash

      kill -SIGHUP <Logstash process ID>
ON THIS PAGE