kubectl create secret
CautionCreate secrets
kubectl create secret generic <name> --from-literal=key=value
Creates generic, TLS and registry secrets — the docker-registry type feeds imagePullSecrets.
Examples
kubectl create secret docker-registry regcred --docker-server=ghcr.io --docker-username=u --docker-password=$TOKENRegistry pull credentials
Syntax
kubectl create secret generic|tls|docker-registry <name> --from-literal|--from-file|--cert/--key
Before you run it
Keep secrets out of shell history.
Related commands
- kubectl get secretInspect Secrets
- docker loginRegistry login
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store