Declarative management of Kubernetes objects is much closer to the spirit of Kubernetes—you focus on telling Kubernetes what you want (describing the desired state) instead of directly telling it what to do. As your application grows and has more components, managing the cluster using imperative commands becomes impossible. It is a much better idea to use imperative commands for read-only operations, such as kubectl describe, kubectl get, and kubectl logs, and perform all modifications to the clusters desired state using the kubectl apply command and Kubernetes object configuration files (also known as manifest files).
There are a couple of recommended practices when using manifest files:
- It's preferable to use YAML manifest files over JSON manifest files. YAML is easier to manage and more commonly used by Kubernetes community.
- Store...