Table of Contents
Monokle is a great tool to inspect your Kubernetes manifests with an easy and intuitive interface showing you how your manifests are connected to each other and how they translate to your existing cluster. It also allows your team to avoid drifts between your manifests and clusters as you keep adding more and more components.
Apart from inspecting your existing manifests, Monokle allows you to create manifests both from scratch and from templates. These templates help you gain speed while creating new components, but more importantly, they reduce grounds for errors from wrongly misconfiguring them.
For example, if your team has a policy of adding a specific property to every component, you can enforce the correct creation of these properties in your template instead of having the developer manually create the manifest and forgetting to add the required property.
When you create your templates with Monokle, you will be able to have a form that developers will fill out to create the resources they need, as seen in the example below.
Monokle comes with a number of default templates to get you started with Kubernetes, and In this tutorial, you will learn how to make your own template for a simple Kubernetes Pod.
Setting up the project
For this template, we need three different parts:
- a Monokle template configuration
- a Form configuration
- and a Kubernetes YAML manifest with placeholders
We will expand about those in the next section while we are creating them.
Creating the template
1. Monokle template configuration
2. Form configuration
3. YAML manifest template
Upload your project to Github
Importing your template in Monokle
Now that we have defined our template configuration, the form definition and our manifest with its placeholders, we need to import the template to Monokle in our configured project.
Click on the plugin section, on the top left of Monokle’s interface
Click on install, and add your Github repository link on the prompted field.
You will now find your brand new plugin in the Plugin Manager, as shown below
If you check the Templates section, you’ll now find your new template available to use.
Using your template
Let’s create a basic pod by using the template and filling the form:
Now that the Manifest is created, we can save it and deploy it!
And just like that, you’ve created a template! 🥳
All the steps from this tutorial can be found in this Github repository – feel free to clone it, make your own changes and use it as a starting point to your new templates. You can also read and learn more in the Monokle documentation about plugins and templates.
Check Monokle on GitHub — and let us know if you’re missing something we should be adding to make your everyday life with k8s manifests and resources easier.
- Download the latest release on GitHub
- Check out the documentation
- Get in touch with us on our Discord server