Secrets

The kubernetes.io/basic-auth type is provided for storing credentials needed for basic authentication.

When using this Secret type, the data field of the Secret must contain the following two keys:

  • username: the user name for authentication;

  • password: the password or token for authentication.

Both values for the above two keys are base64 encoded strings.

You can, of course, provide the clear text content using the stringData for Secret creation.

  1. Create a Basic Auth Secret

kubectl apply -f basic-auth-secret.yaml
  1. Get the Secrets List

kubectl get secrets
  1. You can view a description of the Secret

kubectl describe secrets/secret-basic-auth

Last updated