Secret

    Sign in with project-regular, enter into one project (e.g. demo-namespace), then select Configuration Center → Secrets.

    1.1. Click Create Secret button, then fill in the basic information in the pop-up window. There are two ways to create a Secret, i.e. fill in the creation table and edit mode. The following mainly introduces each step within creation table. If you prefer edit mode, you can click on the edit mode button, it supports the yaml and json formats. Edit mode makes it easy for users who are used to command operations.

    Edit Mode

    • Name: A concise and clear name for this Secret, which is convenient for users to browse and search.
    • Alias: Helps you better distinguish resources and supports Chinese.

    Click Next when you’re done.

    Step 2: Secret Settings

    In the Secret settings, the following 4 types are supported:

    • Default (Opaque): Secret in base 64 encoding format, used to store passwords, sensitive data, etc. See this following example:
    • TLS (kubernetes.io/tls): Commonly used to save information such as TLS certificates and private keys. It can be used to encrypt Ingress. The TLS secret must contain keys named tls.crt and tls.key, saved with Credential and Private Key. See this following example:
    1. Data:
    2. Tls.crt: base64 encoded cert
    3. Metadata:
    4. Namespace: default
    5. Type: kubernetes.io/tls
    • Image Repository Secret (kubernetes.io/dockerconfigjson): It’s used to store the authentication information of the image registry, such as the following information, see : - Repository address: dockerhub.qingcloud.com - Username: guest - Password: ‘guest’ - Email: 123@test.com

    Secret Settings

    Using a Secret

    Secrets can be mounted as data volumes or be exposed as environment variables to be used by a container in a pod.

    • In the Environment Variables, click Reference Config Center then select the created key.

    Using a Secret