FahamLah

Commands

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=3

A standing order: always 3 trays of nginx.

$ kubectl create deployment shop --image=nginx:1.29-alpine --dry-run=client -o yaml

Print the YAML, create nothing.

$ kubectl create namespace food

Make a new zone called food.