A secret is a resource type used to store sensitive information, such as authentication credentials and keys required by workloads.
Create a secret
You can create global secrets or secrets for a single cluster.
Create a federated secret
Log on to the LHC console. In the navigation pane on the left, click Configuration Management > Secrets.
On the Secrets page, click Create.
On the Create Secret page, configure the following parameters:
Namespace: Select a namespace.
Name: Enter a name for the secret.
Secret Type:
Opaque: A generic secret type. Enter a variable name and a value. The value must be Base64-encoded.
ImagePullSecret: Stores authentication information required to pull images from a private repository. Enter the container registry address, username, logon password, and an optional mailbox.
Custom Configuration: Turn on this switch to customize configuration items at the deployment unit level. This feature is disabled by default.
After you complete the configuration, click Create.
Create a single-cluster secret
Log on to the LHC console. In the navigation pane on the left, click Cluster Management > Clusters to go to the cluster list page.
Click the name of the destination cluster to open the Cluster Details page, and then click the Configuration tab.
In the navigation pane on the left, select Secrets.
(Optional) Select a namespace. If you do not select a namespace, the default namespace is used.
Click Create. On the Create Secret page, configure the following parameters:
Namespace: This parameter is automatically populated based on your selection in the previous step. The default value is default.
Name: Enter a name for the secret.
Secret Type:
Opaque: A generic secret type. Enter a variable name and a value. The value must be Base64-encoded.
ImagePullSecret: Stores authentication information required to pull images from a private repository. Enter the container registry address, username, and logon password.
After you complete the configuration, click Submit.
Modify a secret
You can modify the data of Opaque secrets.
Log on to the LHC console. In the navigation pane on the left, click Configuration Management > Secrets.
On the Secrets page, click the name of the secret to open its details page.
You can perform the following modifications:
Click Edit to modify existing configuration item data, and then click Submit.
Click Add Secret Data to add a variable name and value, and then click Submit.
View a secret
Log on to the LHC console. In the navigation pane on the left, click Configuration Management > Secrets.
On the Secrets page, click the name of the secret to open its details page.
For Opaque secrets, you can add more secret data.
Delete a secret
Deleting a secret can affect application containers that reference it. Before you delete a secret, make sure that no application containers reference it.
On the Secrets page, click Delete.
In the dialog box that appears, click Confirm.