kubectl apply -f
kubectl apply -f <file|folder> [--dry-run=client|server] | -k <folder>
Risk: Careful
What it does
Makes the cluster match your YAML file. Creates or changes objects.
When to use it
To create or update anything from a file you keep in Git.
Example
$ kubectl apply -f shop.yamlPut up the order written in shop.yaml.
$ kubectl apply -f shop.yaml --dry-run=serverAsk the cluster to check it, change nothing.
$ kubectl diff -f shop.yamlSee what apply would change first.
Learn it in: Anatomy of a manifest · Official docs