JAEN

Kubernetes

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

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store