Declarative vs Imperative
Imperative:
kubectl run nginx --image=nginx
Declarative:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 2
template:
spec:
containers:
- name: nginx
image: nginx
Prefer declarative (YAML) for production & GitOps