Kubernetes Kubectl Run Command: Understanding Its Evolving Behavior
kubectl run creates a Pod by default post-1.18, not a Deployment. Use declarative YAML for production workloads & prefer kubectl create for controllers to avoid confusion.
The kubectl run command is frequently misunderstood due to its evolving behavior, ambiguous use cases, and overlap with other Kubernetes commands. Below is a breakdown of why confusion persists, especially among beginners and those preparing for the CKA exam: 1. Behavior Changed Drastically Across Kubernetes Versions Pre-1.18: kubectl run created a Deployment by default. For example: kubectl run nginx --image=nginx This generated a Deployment, ReplicaSet, and Pod. Users familiar with older versions might still expect this behavior. Post-1.18: The command was simpli...