MONOKLE: Manage Your K8s Manifests

MONOKLE: Manage Your K8s Manifests

Shivam Katare's photo
Shivam Katare
ยทJul 12, 2022ยท

7 min read

Subscribe to our newsletter and never miss any upcoming articles

Table of contents

  • Prerequisites
  • Features Of Monokle
  • Hands-On Demo Of Monokle
  • Conclusion

Hello Hashnode Community, today we will discuss a fantastic Open Source DevOps tool that will allow us to optimize our lives.

If you are just started with Kubernetes and are using it in production, such as studying or preparing for certifications, this tool will be handy.

So, let's see an example first. Let's say you're working with YAML files, and you have a Kubernetes YAML file that looks something like this ๐Ÿ‘‡

m2.png

And you want to debug or alter something in this file, but imagine you have a massive file with a lot of resources and objects and all these other kinds of stuff. As a result, troubleshooting and managing the Kubernetes manifest is difficult and time-consuming.

  • So, we will learn about a tool that will help us solve these problems. As I previously stated, if you're working with K8s or are just getting started with Kubernetes manifests, we have a tool to help you manage those files.

So, how do we make it easy for you to manage your Kubernetes manifest files? Come into the picture, Monokle by Kubeshop.

Monokle makes it easy for you to manage and debug your manifests before you deploy them to your cluster.

So, we will see:

  • Features Of Monokle
  • Hands-On Demo of Monokle
  • How we can work with Kustomize in Monokle
  • and, So many Other Things

Prerequisites

  • Basic knowledge of K8s
  • Basic knowledge of Dockers

So, let's get started.

Features Of Monokle

So, firstly we'll see some Features Of Monokle then we will get the hands-on demo of it.

1๏ธโƒฃ Accelerate your K8s Manifest workflows.

2๏ธโƒฃ Real-time alerting of syntax, schema, and reference errors. ๐Ÿ‘‡

image.png

3๏ธโƒฃ Maintain cluster resources in real-time.

4๏ธโƒฃ Modify your resources directly with form and source editors (You don't need to edit your YAML files).

5๏ธโƒฃ Ensure deployment success the first time, so you can get back to coding (no need to wait for K8s to show you what is wrong).

So, these are some features of Monokle. Now it's time to take a Deep Dive into monokle and get our hands dirty.

Hands-On Demo Of Monokle

-So, here you can see that monokle is a desktop UI for managing Kubernetes manifests that provides a high-level overview of all your manifests.

m3.png

So, before moving forward, let me show you a short definition of Monokle.

Monokle helps you 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.

To begin downloading Monokle, click the Download Button.๐Ÿ‘‡

m3.png

And, then you can download for Windows, Mac OS, and Linux. You can also check out the Source Code if you want to explore it more.

m4.png

Now, if you're not familiar with Kustomize or Helm Charts or you don't have kubctl installed on your device then, we will work with default created files.

So, for this click here. You will come to this page๐Ÿ‘‡.

09.07.2022_08.13.48_REC.png

Click on the "Green Button" and Clone the repository (If you want to contribute to Monokle, you can also fork it).

If you are not familiar with Git and GitHub, then you can check out this tutorial.

After cloning the repository, launch Monokle to see this type of interface.๐Ÿ‘‡

image.png

Here ๐Ÿ‘† you can see three options. You can choose any one of them.

As we have already cloned the repository, we will choose the first option. You can select the second option if you want to build from scratch or the third option if you wish to choose from the default templates.

So, after clicking on the first option, select the folder. Navigate to the folder where you cloned the repository, then there select ๐Ÿ‘‡

argo-rollouts

and within it selects ๐Ÿ‘‡

manifests

Like this: image.png

Now, after selecting the location and folder, we'll see that now monokle open up our folder that looks like this.๐Ÿ‘‡

image.png

We now have too many alternatives, which we shall explore individually.

1. Filter

So, the first feature we can say is Filter Option. Here we can filter out our pods, services, ingress, job, etc. We can also create new resources and set the namespaces. (You can see that here)๐Ÿ‘‡

image.png

You can see that here ๐Ÿ‘† I have filtered out with โ€œService Accountโ€.

2. Kustomize Navigation (Working with Kustomize File)

Here we have the Kustomize Option, where we can navigate and explore more things.

image.png

The Kustomizations section shows all kustomization.yaml files.

โ€” The corresponding kustomization.yaml file has been highlighted to the left.

โ€” All โ€œdownstreamโ€ kustomizations and included resources are highlighted in the Navigator, helping you understand the โ€œscopeโ€ of the selected kustomization.

โ€” The content of the kustomzation resource is shown in the Source editor to the right, with corresponding resource links marked in the code.

Just as with K8s resources, hovering over the link-icon to the right of the kustomization name shows its outgoing links:๐Ÿ‘‡

image.png

Hovering the link-icon to the left of the kustomization name shows its incoming links.๐Ÿ‘‡

image.png

3. Kustomize Preview

So here we have Preview Functionality. The Preview functionality helps you understand what resources would be installed in your cluster when running kustomize.

Hovering over a kustomization reveals Preview action to the right:

image.png

(Preview Action) look like this ๐Ÿ‘‡(only if you have installed "kubectl")

image.png

otherwise, it will show this error๐Ÿ‘‡

image.png

For example, previewing the "base" kustomization above will result in the following:

image.png

Monokle is now in Preview Mode (as indicated by the header at the top):

  • The File Explorer has been disabled.

  • The Navigator now contains all resources generated by running Kustomize with the "base" kustomization:

    โšซ Resource navigation works as with files; selecting a resource shows its content in the source editor in read-only mode.

    โšซ Resource links are shown as before with corresponding popups/links/etc.

  • Selecting Preview for a different kustomization will switch the output of kustomize to that resource instead.

  • Selecting Exit in the top right or next to the kustomization restores the previous resource navigator.

Here, we can see that the selected kustomization resulted in 7 resources that contain references to the image specified in the kustomization configuration:๐Ÿ‘‡

image.png

4. No Need To Edit YAML

We no longer need to alter large YAML files thanks to Monokle's this feature. Monokle makes it easy for us.

Example

Here, I have a YAML file, which is tiny (you can take any big or small YAML file).๐Ÿ‘‡

image.png

Now, if I want to edit this ๐Ÿ‘† file, it will be easy. But if we have a large YAML with a lot of content, it would be hard for us to manage and change it. So for that, we have an option of Forms. ๐Ÿ‘‡

image.png

I have a YAML file with various port settings that I want to alter here. So what I should do in that case is:

image.png

Click on Forms image.png

Find port (find which value you want to change)

Here, I will change the port value from 8090 to 8080. ๐Ÿ‘‡

image.png

Now you can see that the port value has changed in the YAML file.

image.png

-Maybe it's not that much needed for small YAML files, but it's necessary for big YAML files.

5. Editing of Kustomizations During Preview

Last but not least, when previewing a kustomization, it is possible to edit the previewed kustomization.yaml file and recreate the preview, allowing you to quickly assess the impact of any changes on the generated files instead of having to exit and restart the preview to make a change.

image.png

Conclusion

So, that's the wrap-up for this blog we learn about:

  • Monokle
  • Features Of Monokle
  • How we can work with Kustomize in Monokle.

For future blogs, we will see:

  • How to work in Monokle with Helm Chart
  • and how we can work with Cloud Clusters.

You can Join Monokle Discord Server, you can also contribute to it.

I hope you find it beneficial. Please share this blog with your friends if you found it useful or if you learned something from it.

Did you find this article valuable?

Support Kubeworld by becoming a sponsor. Any amount is appreciated!

See recent sponsors |ย Learn more about Hashnode Sponsors
ย 
Share this