Create a Kubernetes Secret for MySQL

This section describes how to create a kubernetes secret for MySQL.

  1. Execute the following command to create the kubernetes secret for MySQL:

    kubectl create secret generic <database secret name> --from-literal=dbUserNameKey=<CNCC 
    Mysql database username> --from-literal=dbPasswordKey=<CNCC Mysql database passsword> -n <Namespace of MYSQL secret     
  2. Execute the following command to verify the secret creation:

    $ kubectl describe secret <database secret name> -n <Namespace of MYSQL secret>

    Example:
    $ kubectl create secret generic cncc-db-secret --from-literal=dbUserNameKey=root --from-
    literal=dbPasswordKey=mypass -n cncc
    $ kubectl describe secret cncc-db-secret -n cncc