Sign in
Log inSign up
Creating your own Template in Monokle

Creating your own Template in Monokle

RagulTN's photo
RagulTN
·Aug 20, 2022·

3 min read

What is Monokle?

  • It is used to debug and manifest your files before deploying into cluster. For example you can see what kubernetes object connected with which kubernetes object at which line.
  • Monokle lies in between dev and Ops cycle in devOps, its kind of resource centric view before deploying.
  • After installing monkle when you go to clusters option in the left side of the dashboard ,you can see your deployments and files of kubernetes.
  • you can preview, customize, filter, see metadata of files,see helm charts, etc and separately view the objects in YAML files,you can also create your own projects, add components with various features.
  • Basically working with multinode architecture is a good practice(provided by cloud services like civo), because we cant install many node on our local machine.
  • you can see, compare and replace the resources of your clusters with your local machine and cloud services.
  • After checking all the files you can successfully deploy the cluster.

prerequisites

  • Basics of YAML
  • Basics of Kubernetes like what is pods and clusters

YAML Introduction

  1. YAML is a data serialization language → standard format to transfer data eg : JSON,YAML,XML
  2. YAML is a superset of JSON ie any valid JSON file is also a valid YAML file.
  3. Easy human readable format used for writing configuration files with easy syntax.
  4. Use cases : Docker compose files, ansible, kubernetes etc.
  5. syntax of YAML below
    - app: todoApp  # "-" means lists
        port: 3000    #indentation is important here
        version: 1.7
  - app: userAuth   #list of objects
        port: 6000
        version: 2.0

Creating own template in monokle

  • Monokle also allows you to create your own file (from scratch)or working from a template(we can create newer components with a specific properties ) apart from existing manifest files.
  • Monokle also have some default templates (for basic job ,basic and advanced pods).
    • select one and check information and start
    • give name, Namespaces and Image
    • that's it, your pod was created!

Untitled.png

  • you can see your metadata of files created.
  • Templates in monokle is installed via plugins → for that we use a plugin to create a template (contains package.json file)

Steps to create your own template (plugin)

  1. create a GitHub repository for your monokle template plugin
  2. open your code editor create a package.json file add your JSON file.
  3. create a folder with pathname (in JSON file)
  4. create a monokle-template.json file and decide which type of template your going to choose (Two types - vanila and helm charts)
  5. schema and uischema used by monokle
    1. schema - contains fields, input form to users.
    2. uischema - appearing to the user, UI screen
  6. Refer documentation while creating your template.
  7. push the files to GitHub.
  8. You can also manually install the plugin from your local machine.

Untitled (1).png

  1. Now, you have to create a YAML file (taking input from the user, template acts as a form to receive input).

Add your plugin to monokle

  • Open plugin manager from the top right corner
  • paste URL and download and use plugin

Untitled (2).png

  • you can check your template in the templates section.
  • Here is my plugin Github URL - link

Resources :

youtube.com/watch?v=Rdc31plYOLM&t=0s @KunalKushwaha

Install Monokle

Check out my : twitter.com/RagulSiddh

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct