Skip to content

Viewing secrets

The get command can be used to list secrets and view their contents.

  1. To view a list of all secrets, run the following command.

    kubectl get secrets
    

    If a namepace is beign used, the -n argument must be inclued.

    kubectl get secrets -n namespace\_name
    

    where namespace_name is the name of the namespace.

  2. To view the content of a secret, run the following command.

     kubectl describe secret secret\_name
    

    where secret_name is the name of the secret.

Parent Topic: Managing secrets in Kubernetes