You can use configuration items to store configurations that do not need to be kept confidential, such as the Java virtual machine (JVM) heap memory, JVM properties, and Java agent. This topic describes how to manage configuration items.

Prerequisites

  • A Kubernetes cluster is created in the Container Service for Kubernetes (ACK) console.
    • To use an ACK cluster in Enterprise Distributed Application Service (EDAS), create a managed Kubernetes cluster or a dedicated Kubernetes cluster in the Container Service for Kubernetes (ACK) console. For more information, see the following topics:
    • To use a serverless Kubernetes cluster in EDAS, create a serverless Kubernetes cluster in the Container Service for Kubernetes (ACK) console. For more information, see Create an ASK cluster.
  • The created Kubernetes cluster is imported to EDAS. For more information, see Import a Kubernetes cluster to the EDAS console.

Background information

You can use configuration items to store configurations that do not need to be kept confidential. Configuration items can be passed to containers when you create or deploy applications. If you modify a configuration item, the modification takes effect after you redeploy the relevant application.

You can use configuration items in the following scenarios:

Create a configuration item

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Configuration Management > Kubernetes Configurations > Configuration Items.
  3. In the top navigation bar, select a region.
  4. On the Configuration Items page, click Create configuration item.
  5. In the Create configuration item panel, set the parameters, such as Name and Cluster Name, as required.
    Create configuration item panel
    ParameterDescription
    NameThe name of the configuration item. The name can contain lowercase letters, hyphens (-), and digits. It must start with a letter and cannot end with a hyphen (-). The name can be up to 63 characters in length.
    Cluster NameThe Kubernetes cluster for which you want to create the configuration item. Select the required Kubernetes cluster from the drop-down list.
    k8sNameSpaceThe Kubernetes namespace of the cluster. Internal system objects are allocated to different Kubernetes namespaces to form logically isolated projects, groups, or user groups. This way, different groups can be separately managed but can also share the resources of the entire cluster. Valid values:
    • default: the default Kubernetes namespace. If no Kubernetes namespace is specified for an object, the default Kubernetes namespace is used.
    • kube-system: the Kubernetes namespace for the objects that are created by the system.
    • kube-public: the Kubernetes namespace that is automatically created and can be read by all users, including users who are not authenticated.

    In this example, default is selected.

  6. In the Create configuration item panel, specify configuration mapping in the form of key-value pairs and click Yes.
    You can manually add key-value pairs or import key-value pairs from a file. Select a method as required. Multiple key-value pairs are supported in a single configuration item.
    • Manually add key-value pairs.

      Click Add and set the Key and Value parameters.

      ParameterDescription
      KeyThe key in the configuration. The key can contain letters, digits, underscores (_), hyphens (-), and periods (.).
      ValueThe value in the configuration.
    • Import key-value pairs from a file.

      Choose Import Configuration > Import From File and select the required file. After you upload a file, EDAS automatically parses the data in the file to extract the key-value pairs contained in the file.

      Before EDAS parses a file, EDAS checks the format of the file. Only JSON, YAML, and .properties files are supported.

      Note You must add key-value pairs to your file based on the file format. The following examples show how to specify key-value pairs in files of different formats.
      • JSON format
        {
          "key1": "value1",
          "key2": "value2",
        }
      • YAML format
        key1: value1
        key2: value2
      • .properties file format
        key1=value1
        key2=value2

View a configuration item

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Configuration Management > Kubernetes Configurations > Configuration Items.
  3. In the top navigation bar, select a region. Then, on the Configuration Items page, select a microservices namespace.
  4. On the Configuration Items page, find the configuration item that you want to view and click Details.
    You can search for the required configuration item by setting the ConfigName, Cluster, Cluster Id, and k8sNamespace parameters.
  5. On the details page, view the basic information about the configuration item and the key-value pairs in the configuration item.

Modify a configuration item

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Configuration Management > Kubernetes Configurations > Configuration Items.
  3. In the top navigation bar, select a region. Then, on the Configuration Items page, select a microservices namespace.
  4. On the Configuration Items page, find the configuration item that you want to modify and click Edit.
    You can search for the required configuration item by setting the ConfigName, Cluster, Cluster Id, and k8sNamespace parameters.
  5. In the editing panel, modify the keys and values in the configuration item based on your requirements and click Yes.
    Note If the configuration item is used by an application, redeploy the application after you modify the configuration item. Otherwise, the updated configurations do not take effect in the application.

Delete a configuration item

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Configuration Management > Kubernetes Configurations > Configuration Items.
  3. In the top navigation bar, select a region. Then, on the Configuration Items page, select a microservices namespace.
  4. On the Configuration Items page, find the configuration item that you want to delete and click Delete.
    You can search for the required configuration item by setting the ConfigName, Cluster, Cluster Id, and k8sNamespace parameters.
  5. In the message that appears, click Yes.
    Note We recommend that you do not delete a configuration item if it is used by an application. If you delete a configuration item that is used by an application, the application cannot properly run after you restart or redeploy the application.