# Kubernetes tip 4: Update a Secret from files

A small Kubernetes tip that saves time when updating TLS secrets. If your secret is generated from files, you do not need to delete and recreate it manually:

```bash
kubectl create secret generic production-tls \
  --from-file=./tls.key \
  --from-file=./tls.crt \
  --dry-run=client -o yaml | kubectl apply -f -
```

This is a clean way to update a secret in a repeatable way, especially in scripts or CI/CD pipelines.

![Terminal screenshot of the kubectl secret update command](https://images.koorevaar.com/linkedin-import/aks-update-secret-from-files-tip-4.jpg)

---

*Co-authored with Claude.*

If this was useful, [you can buy me a coffee](https://ko-fi.com/p47k0).

New articles: [follow via RSS](https://blog.koorevaar.com/feed.xml).
