Secrets

Secrets store sensitive, user-defined information such as authentication details or keys, and can then be loaded to containerized applications. For example, a secret can be loaded into a container as a file during volume configuration.

Secrets may involve sensitive user information. If the secrets you attempt to configure contain sensitive information, you need to encrypt them before entering them and also need to decrypt them through applications.

Creating a Secret

  1. Log in to the IEF console.
  2. In the navigation pane, choose Edge Applications > Application Configuration. Then, click Create Secret in the upper right corner.
  3. Specify the secret details.

    Figure 1 Creating a secret
    • Name: name of the secret.
    • Type: Opaque secrets are supported. The data of the Opaque type is key-value pairs. The values are encoded in Base64. For details, see Base64 Encoding.
    • Data: They are key-value pairs. Enter a property name and value. The value must be a Base64-encoded string.

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

Base64 Encoding

To perform Base64 encoding on a character string, run the echo -n {Content to be encoded} | base64 command. For example:

root@ubuntu:~# echo -n "example value" | base64
ZXhhbXBsZSB2YWx1ZQ==

Using a Secret

You can use secrets when configuring volumes during application creation.

Figure 2 Using a secret

After the secret is mounted to the container, files are created in the mount directory based on the secret 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 secret could have the property name set to key and the property value set to ZXhhbXBsZSB2YWx1ZQ==. After the secret is mounted to the /tmp2 directory, a file named key is generated in the /tmp2 directory and the file content is example value.