Create a YAML Manifest Template in Monokle
Hello Everyone ๐โโ๏ธ
๐ฅ 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
- Click on Start from a template
2. Type the Project Name(whatever you want) and Location(where you want to save the file)..
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.
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:
๐ฏ Step-2: Creating the template
Create a folder named deployment-template
and add the following file:
- 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.
๐ 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 thepackage.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