Kubernetes YAMLs — What do I put in here again?

Frank Gerold
Sep 10 · 3 min read
Image for post
Image for post
Photo by James Wainscoat on Unsplash

Using Kubernetes to manage and coordinate multi-container or distributed applications is becoming more and more common and necessary as certain software architectures become standardized as “best practices.” This makes learning how to use Kubernetes (or K8s) an important skill for all web developers to at least gain a basic working knowledge for troubleshooting purposes.

Whether you are just working through your first tutorials, or you’re a seasoned senior K8s administrator, there is one chore that never goes away when dealing with your k8 setup — filling out the configuration YAML files. I suppose you could, theoretically, manually create each object, imperatively, from the command line to avoid the horrors of yaml writing, but this becomes impossible as your application scales up and you need to rely on the control plane automation for the app to even run with more than a handful of users.

No matter how many times you write out a basic boilerplate deployment config, it is impossible to remember exactly what needs to be there the next time you make one. It’s not like they are these crazy incomprehensible documents either, they make perfect sense when reading them — they just literally describe the desired working state of the deployment/service/whatever you need, and k8s does the rest of the work for you. There is some sort of psychological sorcery involved in these yaml files, however, that make the specifics flow out of your mind like a sieve.

So far the main technique I have used to write out all my configs has been Googling the specific object I’m trying to create and copying off of the default config docs, adding the necessary info for my use case. The official Deployment and Service docs have seen heavy use, as well as the other various controllers and services I might need to use. After writing out the first deployment, service, and ingress based off Google or checking some older app of mine, I usually just duplicate them as needed within my infra directory and change the names and details.

A New Solution

The folks over at Octopus Deploy have created a really handy reference page that might save you a lot of time when setting up your yaml configs: The Kubernetes Yaml Generator! Through convenient and easy to read dropdown menus, you can go through all the options for a k8s config. Every option has a convenient description to go along with it, as well as a link to the relevant documentation for more info. It generates the complete yaml as you change the settings, making it a live, up-to-date, interactive way for you to create all of your config files.

Maybe this tool can provide much needed relief from the endless yaml googling we all fall into during our k8s endeavors!

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Sign up for Best Stories

By Dev Genius

The best stories sent monthly to your email. Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Frank Gerold

Written by

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Frank Gerold

Written by

Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store