> For the complete documentation index, see [llms.txt](https://amdocs-1.gitbook.io/kubernetes-handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://amdocs-1.gitbook.io/kubernetes-handbook/config-maps-and-secrets/secrets.md).

# Secrets

Secrets are useful for encrypting user credentials inside your pods or services.

## Working with Secrets

**Creating a secret**

```
$ kubectl create secret generic apikey —from-literal=api_key=186289106
```

**List all secrets**

```
$ kubectl get secrets
```

**Ouput the secret as a yaml file**

```
$ kubectl get secret apikey -o yaml
```
