Create a YAML Manifest Template in Monokle

Hello Everyone ๐Ÿ™‹โ€โ™€๏ธ

Anuja Kumari
6 min readFeb 20, 2022

๐Ÿ’ฅ In this article Iโ€™m explaining about Monokle and How can we create our own YAML Manifest Template in Monokle ๐Ÿš€

Letโ€™s Start ๐Ÿคฉ

๐Ÿ‘‰ What is Kubernetes?๐ŸŽก

Kubernetes, also known as K8s, is an open-source container orchestration system for automating software deployment, scaling, and management.

๐Ÿ‘‰ What is Monokle ?

Monokle is a friendly desktop UI for creating, validating, debugging and managing Kubernetes manifests.

Monokle helps you to:

  • quickly get a high-level view of your manifests and their contained resources
  • easily edit resources without having to learn yaml syntax,
  • diff resources against your cluster,
  • preview and debug resources generated with kustomize or Helm, and more.
  • It also allows your team to avoid drifts between your manifests and clusters as you keep adding more and more components.

โœ… Monokle is made by Kubeshop : a first of its kind open-source accelerator-incubator focused on Kubernetes.

โœ… Once you understand how your manifests work and work together, Monokle lets you easily edit resources without having to learn or look up YAML syntax. You can refactor manifests while still maintaining the integrity of names and references throughout all of them.

๐Ÿ‘‰ How does Monokle fit in with existing tooling :

๐Ÿ‘‰ What is a Monokle Template ?

A Monokle Template is a mechanism for creating visual forms and interpolating the data from those forms into one or multiple manifests.

For each form, we must define the JSON schema of the data to use as an input and a UI-schema for customizing the visuals of the forms.

๐Ÿ‘‰ What is a Plugin ?

Simply, any GitHub repository that contains a package.json file (the plugin entry file) can be installed as a plugin if the entry file follows the structure of a Monokle plugin.

๐Ÿ‘‰What are Kubernetes Resources?

A resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind; for example, the built-in pods resource contains a collection of Pod objects.

๐Ÿ‘‰What is Pod ?

Pods are the smallest, most basic deployable objects in Kubernetes. A Pod represents a single instance of a running process in your cluster. Pods contain one or more containers, such as Docker containers. When a Pod runs multiple containers, the containers are managed as a single entity and share the Podโ€™s resources.

๐Ÿ‘‰What is Deployment ?

A Kubernetes deployment is a resource object in Kubernetes that provides declarative updates to applications. A deployment allows you to describe an applicationโ€™s life cycle, such as which images to use for the app, the number of pods there should be, and the way in which they should be updated.

Getting Started with Monokle ๐Ÿฅณ

๐Ÿ”… Installing Monokle

Checkout the below URL where you can download monokle according to your operating system

๐Ÿ”… Getting Starting Page

๐Ÿ”… First , Letโ€™s use the default template of Monokole

  1. Click on Start from a template

2. Type the Project Name(whatever you want) and Location(where you want to save the file)..

start a project

3. Now select a template. Here I am using โ€œBasic Podโ€ template. Click on use Template.

4. Enter Pod name , image and Namespace(optional). Then click on Submit.

Pod Settings

5. So, you can see our pod resource is successfully created.

6. Click on Done.

You can find the YAML manifest file as shown below๐Ÿคฉ

Its so quick we have created the manifest file for pod without writing YAML file by itโ€™s own and without worrying about itโ€™s syntax..

๐Ÿ”… Now, Lets start creating our own YAML Manifest Template ๐Ÿคฉ

๐ŸŽฏ Step-1. Creating the Plugin Entry File

create package.json file:

package.json

๐ŸŽฏ Step-2: Creating the template

Create a folder named deployment-template and add the following file:

  1. create monokle-template.json file:
monokle-template.json

2. Create form-schema.json file:

form-schema.json

3. Create form-ui-schema.json file:

form-ui-schema.json

4. Create template.yaml file:

template.yaml

๐ŸŽฏ Step-3 : Push All the code to GitHub

checkout the code on my GitHub repo: https://github.com/Anujakumari/monokle-templates-plugin

๐ŸŽฏ Step-4 : Now install the Plugin

๐Ÿ‘‰ Click on Open Plugins manager from the top right icon.

Open Plugins Manager

๐Ÿ‘‰ Click on the โ€˜+ installโ€™ button.

๐Ÿ‘‰ Here they asking for the Plugin URL.

Paste the GitHub repo URL then click on Download and install plugin.

NOTE:

  • The URL must be a valid GitHub repository url in the format https://github.com/[username]/[repo-name].
  • And the primary branch should be main. The plugin installer will search there for the package.json file.

๐Ÿ‘‰ Finally the template-plugin created ๐Ÿคฉ

You will now find your new plugin in the Plugin Manager, as shown below

๐Ÿ”… Now Letโ€™s see our templates and test it :

๐Ÿ‘‰ Click on View Templates

๐Ÿ‘‰ Here is our template, as shown below:

๐Ÿ‘‰ Now click on Use Template

Now click on start

๐Ÿ‘‰ Letโ€™s create a deployment by using the template

๐Ÿ‘‰ Click on Submit and the deployment resource is createdโ€ฆ..

Tadaaaโ€ฆ the Manifest is created๐Ÿฅณ we can save it and deploy it!

Thanks for Reading !! ๐Ÿ™Œ๐Ÿป๐Ÿ“ƒ

๐Ÿ”ฐ Keep Learning !! Keep Sharing !! ๐Ÿ”ฐ

๐Ÿš€ Feel free to connect with me :

LinkedIn : https://www.linkedin.com/in/anujakumari
GitHub : https://github.com/Anujakumari
Twitter : https://twitter.com/anuja6204

--

--

Anuja Kumari

Learner @ Linuxworld Informative Pvt Ltd || DevOps(Docker,K8S, Jenkins, Terraform, Git and GitHub) || AWS || ( Python | Java )