All Products
Search
Document Center

Serverless App Engine:Inject K8s Secret

Last Updated:Sep 09, 2025

K8s Secret separates sensitive information from application code. This lets you securely pass and use sensitive information in your applications. This topic describes how to inject a secret from an SAE namespace into a container.

Prerequisites

A K8s Secret is created in the namespace. For more information, see Manage and use secrets (K8s Secret).

Procedure

  1. The following contents describe the procedure for different scenarios:

    Create an application

    1. Log on to the SAE console. In the left-side navigation pane, choose Applications > Applications. On the page that appears, select a region in the top navigation bar and a namespace from the Namespace drop-down list, and then click Create Application.

    2. After the Basic Information is specified on Create Application page, click Next: Advanced Settings.

    Modify running applications

    Warning

    After you redeploy an application, the application is restarted. To prevent unpredictable errors such as business interruptions, we recommend that you deploy applications during off-peak hours.

    1. Log on to the SAE console. In the left-side navigation pane, choose Applications > Applications. On the page that appears, select a region in the top navigation bar and a namespace from the Namespace drop-down list, and then click the desired application name.

    2. On the Basic Information page of the application, click Deploy Application.

    Modify stopped applications

    1. Log on to the SAE console. In the left-side navigation pane, choose Applications > Applications. On the page that appears, select a region in the top navigation bar and a namespace from the Namespace drop-down list, and then click the desired application name.

    2. On the Basic Information page of the application, click Modify Application Configurations.

  2. Expand the Secret area and configure the parameters.

Configuration details

Note

You can create a secret on the Namespaces page in advance, or click Create a Secret in the Secret configuration section.

Click +Add, select an existing The name of the secret and a Key, and then enter a Mount Path.

To mount all keys, select All from the Key drop-down list. This mounts all keys from the secret to the specified path.

image