FahamLah

Commands

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.yaml

Put up the order written in shop.yaml.

$ kubectl apply -f shop.yaml --dry-run=server

Ask the cluster to check it, change nothing.

$ kubectl diff -f shop.yaml

See what apply would change first.