Pods, Deployments, and ReplicaSet are examples of Kubernetes Objects. Kubernetes provides you with multiple approaches to run and manage them.
kubectl run
—imperative: You provide instructions through the command line to the Kubernetes API to carry outkubectl create
—imperative: You provide instructions, in the form of a configuration file, to the Kubernetes API to carry out
kubectl apply
—declarative: You tell the Kubernetes API the desired state of your cluster using configuration file(s), and Kubernetes will figure out the operations required to reach that state
kubectl create
is a slight improvement to kubectl run
because the configuration file(s) can now be version controlled; however, it is still not ideal due to its imperative nature.
If we use the imperative approach, we'd be manipulating the Kubernetes object(s) directly, and thus be responsible for monitoring all Kubernetes objects. This essentially defeats the point of having a Cluster Management Tool.
The...