I'm new to Kubernetes and I've been using YAML for all my provisioning tasks, including secrets, deployments, and Helm Charts, which I keep in Git. Most guides I come across focus on using the kubectl command-line interface (CLI) instead of YAML files. For example, they often show how to add a Helm repository but don't explain how to do it using YAML.
I use ArgoCD for provisioning and Kustomize for setting up base services like sealed secrets, ArgoCD itself, and namespaces. Since I'm afraid of forgetting commands to run for setting up a cluster, I lean towards YAML files instead.
Is this approach not common? I think of my Kubernetes setup as something that should be recoverable. If there's a major issue, I prefer to just set up a new cluster, deploy from the latest Git commit, and restore from backup rather than debugging deeply.
I haven't worked on production clusters or used Kubernetes in a workplace environment, so I'd love to hear if I'm missing something or if there's better advice for a newbie like me!
5 Answers
YAML is great for versioning because it lets you store all your manifests in a repo. The CLI is handy for quick actions but isn’t as effective for complex objects with multiple fields. I mainly use the CLI for testing stuff; everything else goes into some CI/CD pipeline.
Using the CLI to create YAML resources is definitely a teaching method. It's often quicker to show someone a command than to go through the intricate details of a whole YAML file. But in real-world applications, you'd want all your configurations in YAML stored in Git for tracking and deploying, so don’t feel bad for preferring that!
You can actually add `--dry-run=client -o yaml` to your kubectl commands, which can help generate the YAML you need. But I feel you, most guides definitely favor the CLI because it simplifies the learning curve. For example, when I was checking out Traefik, I found that they only talk about the Helm approach to install it, which made it tricky to convert my YAML. It's strange that more tutorials don’t cover this – it’s a valid concern!
Exactly! I'm in the same boat. It feels like all the cool features using YAML get sidelined in favor of the CLI commands.
Honestly, I rarely touch the CLI either. Most of my work is done through YAML and managed via ArgoCD. I may use CLI commands from time to time when I need to log in or do a quick check, but my main focus is always on managing the configs through version control.
The CLI is often used for spinning up clusters or for quick tests with Minikube or Kind. But once you’re in production, it's really about keeping everything versioned and consistent with configuration management tools or GitOps. Tracking changes is important so you know what caused issues if they arise.

True! I was initially confused by how much the tutorials focused on the CLI, but it’s good to hear everyone feels the same way.