This topic describes how to create a Secret in a cluster of Container Service for Kubernetes (ACK) in the ACK console.
We recommend that you use Secrets to store sensitive information in Kubernetes clusters, such as passwords and certificates.
Secrets are classified into the following types:
- Service Account: This type of secret is automatically created by Kubernetes and is automatically mounted to the /run/secrets/kubernetes.io/serviceaccount directory of a pod. You can use this type of Secret to access the Kubernetes API server.
- Opaque: This type of secret is encoded in Base64 and used to store sensitive information, such as passwords and certificates.
You can create only Opaque Secrets in the ACK console. Opaque Secrets store map type data. Therefore, values must be encoded in Base64. You can quickly create a Secret in the ACK console. The plaintext is automatically encoded in Base64.
You can also create Secrets by using the command-line interface (CLI). For more information, see Kubernetes secrets.
- Log on to the Container Service for Kubernetes (ACK) console.
- In the left-side navigation pane, click Clusters.
- On the Clusters page, find the cluster that you want to manage and click Details in the Actions column.
- In the left-side navigation pane, click Configurations.
- Click the Secrets tab. In the upper-right corner of the Secrets tab, click Create.
- In the Create pane, configure the Secret.
- Name: Enter a name for the Secret. The name must be 1 to 253 characters in length, and can contain only lowercase letters, digits, hyphens (-), and periods (.).
- Type: Select a Secret type.
- To enter Secret data in plaintext, select Encode Data Values Using Base64.
- Enter key-value pairs. Click + Add to enter keys and values.
- Click OK.