Imperative vs Declarative Approach¶
Imperative approach describes HOW
the program executes, while the declarative approach describes WHAT
programs to be executed.
The imperative approach is good for learning and interactive experimentation (e.g. Python Interactive Shell)
The declarative approach is good for reproducible deployments and for production.
There are two ways to deploy to Kubernetes:
- Imperatively, with the
kubectl
commands - Declaratively, by writing manifests and using
kubectl apply