# 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

```bash
kubectl apply -f basic-auth-secret.yaml
```

1. Get the Secrets List

```bash
kubectl get secrets
```

1. You can view a description of the Secret

```bash
kubectl describe secrets/secret-basic-auth
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nishanthkp.gitbook.io/kubernetes-security-with-calico-and-istio/understand-k8s/secret.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
