Skip to content

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:

  1. Imperatively, with the kubectl commands
  2. Declaratively, by writing manifests and using kubectl apply