Manage Secrets
Create, view, edit, and delete Secrets in a Kubernetes cluster.
Prerequisites
A Kubernetes cluster is created. For instructions, see Create an ACK managed cluster.
Background information
If you need to use sensitive configuration such as passwords and certificates in a Kubernetes cluster, use a Secret.
Secrets are available in multiple types, for example:
-
Service Account: used to access the Kubernetes API. Kubernetes automatically creates it and mounts it to the /run/secrets/kubernetes.io/serviceaccount directory of the Pod.
-
Opaque: a Secret in Base64 encoding format, used to store sensitive information such as passwords and certificates.
By default, you can create only Secrets of the Opaque type in the ACK console. The data of the Opaque type is a map, and the values must be in Base64 encoding format. ACK provides automated Secret creation that encodes plaintext data into Base64 format.
Alternatively, manually create a Secret by using the command line. For more information, see kubernetes secret.
Create a Secret
-
Log on to the ACK console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
-
On the Secrets page, select the Namespace to which the Secret belongs, and then click Create in the upper-right corner to configure a new Secret in the panel that appears.
Parameter
Description
Name
Enter the name of the Secret. The name must be 1 to 253 characters in length and can contain only lowercase letters, digits, hyphens (-), and periods (.).
Type
Includes Opaque, Private Repository Logon Secret, and TLS Certificate.
Opaque
If Type is set to Opaque, configure the following parameters:
-
Optional: If you enter plaintext data for the Secret, select Encode Data Values Using Base64.
-
Configure the data of the Secret. Click +Add, and then enter the name and value of the Secret in the Name and Value text boxes.
Private Repository Logon Secret
If Type is set to Private Repository Logon Secret, configure the following parameters:
-
Image Repository Address: Enter the address of the private image repository.
-
Username: Enter the username of the image repository.
-
Password: Enter the password of the image repository.
TLS Certificate
If Type is set to TLS Certificate, configure the following parameters:
-
Cert: Enter the TLS certificate.
-
Key: Enter the TLS certificate key.
-
Related operations
After the Secret is created, you can perform the following operations on the Secrets page:
-
Click the name of the target Secret to view its basic information and details.
Click the
icon to view the data in plaintext. -
In the Actions column on the right side of the name of the target Secret, click Edit to modify the information of the Secret.
-
In the Actions column on the right side of the name of the target Secret, click Delete to delete a Secret that you no longer need.
ImportantDo not delete the Secrets that were generated during cluster creation.