kubectl create deployment|namespace|configmap|secret generic|job|service …
kubectl create deployment|namespace|configmap|secret generic|job|service … <name>
Risk: Careful
What it does
Makes one new object from flags, without a file.
When to use it
For quick tries, or to print starter YAML with --dry-run=client -o yaml.
Example
$ kubectl create deployment shop --image=nginx:1.29-alpine --replicas=3A standing order: always 3 trays of nginx.
$ kubectl create deployment shop --image=nginx:1.29-alpine --dry-run=client -o yamlPrint the YAML, create nothing.
$ kubectl create namespace foodMake a new zone called food.
Learn it in: Drive it with kubectl · Official docs