<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Deepankur Singh Baliyan</title>
    <description>The latest articles on Forem by Deepankur Singh Baliyan (@deepankur797).</description>
    <link>https://forem.com/deepankur797</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F594970%2F4fcb1875-99fd-4021-9969-9870b4916132.jpeg</url>
      <title>Forem: Deepankur Singh Baliyan</title>
      <link>https://forem.com/deepankur797</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/deepankur797"/>
    <language>en</language>
    <item>
      <title>Introduction to Multi-Tenancy in Kubernetes</title>
      <dc:creator>Deepankur Singh Baliyan</dc:creator>
      <pubDate>Thu, 09 Dec 2021 09:44:01 +0000</pubDate>
      <link>https://forem.com/deepankur797/introduction-to-multi-tenancy-in-kubernetes-2jpi</link>
      <guid>https://forem.com/deepankur797/introduction-to-multi-tenancy-in-kubernetes-2jpi</guid>
      <description>&lt;h2&gt;
  
  
  What is multi-tenancy?
&lt;/h2&gt;

&lt;p&gt;The idea of sharing a single instance of an application or of software among various tenants is called multi-tenancy. This approach is quite popular since the rise of cloud environments. Now, with the introduction of Kubernetes, developers and administrators require the same approach to be implemented on Kubernetes clusters. As that would provide better resource utilization, provide better management of underlying compute resources, and reduce cost.&lt;/p&gt;

&lt;p&gt;This blog post will discuss various available approaches to introduce multi-tenancy in Kubernetes clusters and will try to draw a comparison between all of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where multi-tenancy serves better?
&lt;/h2&gt;

&lt;p&gt;Before even discussing multi-tenant architecture, one should know whether it is better to deploy a single &lt;a href="https://dev.to/kubernetes-consulting-partner/"&gt;Kubernetes&lt;/a&gt; cluster with multi-tenant support or should deploy multiple clusters, different for each tenant. &lt;/p&gt;

&lt;p&gt;To begin with, there is no specific rule for this and most organizations decide this on the basis of ease of use, management etc. Deploying multiple clusters is simple as you don’t have to worry about following additional best practices such as auditing &lt;a href="https://dev.to/blogs/role-based-access-kubernetes/"&gt;RBAC&lt;/a&gt;, setting up standard practice for users. Besides this, cost also plays an important role while making this decision. If cost is not an issue and you want simple architecture, deploy multiple clusters. Whereas, if your compute need is far less and you want to save some extra cost, multi-tenancy could be a better option. Some other factors also play a vital role such as the lifecycle of your cluster, if your need is only temporary, multi-cluster could be a viable option, as you don’t have to install anything else on your cluster. &lt;/p&gt;

&lt;p&gt;One major drawback of having multiple clusters is the increased management overhead, specially for the large environments, it requires a lot of effort to keep every cluster updated, more &lt;a href="https://dev.to/blogs/kubernetes-auditing/"&gt;security audits&lt;/a&gt; would be required as well. It is worth noting that while you may use a multi-cluster approach, you shouldn’t block future expansion around the multi-tenancy by making some little mistakes like deploying all applications in the same namespace.&lt;/p&gt;

&lt;h2&gt;
  
  
  Different approaches of multi-tenant architecture
&lt;/h2&gt;

&lt;p&gt;Multi-tenancy in Kubernetes can be categorized in two broad terms:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Soft Isolation:&lt;/strong&gt; In this, we have a single enterprise with different teams accessing the same cluster, this requires less amount of security overhead as users can trust each other.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hard isolation:&lt;/strong&gt; This is required where the Kubernetes is exposed to multiple enterprises with independent and completely untrusted users.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are various approaches discussed in &lt;a href="https://static.sched.com/hosted_files/kccnceu19/74/kubecon-eu-multitenancy-wg-deepdive.pdf"&gt;KubeCon Europe 2019&lt;/a&gt; wherein every approach can be enlisted in either of the two mentioned above categories.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J51RnBT3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0vei8bhhfcjhdhetrj9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J51RnBT3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0vei8bhhfcjhdhetrj9.png" alt="Image description" width="880" height="406"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://static.sched.com/hosted_files/kccnceu19/74/kubecon-eu-multitenancy-wg-deepdive.pdf"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above-shown diagram outlines 4 different approaches to consume Kubernetes clusters in your environment.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Approach A&lt;/strong&gt; 
This doesn’t provide an exact multi-tenant solution as it deploys different Kubernetes clusters. However, can be still considered as in this solution each tenant will receive a different Kubernetes cluster, which is completely isolated from any other compute resource. This can be implemented by using segregated VM providers like Amazon EC2, GCP compute instance, and vSphere VM’s. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approach B&lt;/strong&gt; 
This is one of the popular architecture, wherein segregation is based on namespaces. This provides soft isolation among different tenants. With this, tenants can only see, modify, and create objects within their namespace. Moreover, they can create policies for security and roles within their namespace. There are two major drawbacks in this approach, the principal one is shared master components like API server and the other one is the provisioning of Cluster scoped resources. The main work carried out for the development of this approach is done by Project HNC (hierarchical namespaces).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approach C&lt;/strong&gt; 
This approach provides a way to implement hard isolation among Kubernetes tenants who have no trust between them. This provides segregated master plane components for each tenant by creating a mini virtual cluster on the super Kubernetes cluster. Admins can also create custom resources in those virtual clusters as well. This is provided by projects like &lt;a href="https://github.com/kubernetes-sigs/cluster-api-provider-nested/tree/main/virtualcluster"&gt;VirtualCluster&lt;/a&gt; and &lt;a href="https://github.com/loft-sh/vcluster"&gt;vCluster&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approach D&lt;/strong&gt; 
Different from all of the above approaches, this suggests that Kubernetes should provide the support for creating tenants out of the box. It is not yet developed, because of the efforts that it would require to modify the Kubernetes source code. &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Comparison of various solutions
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;VM based Segregation&lt;/th&gt;
&lt;th&gt;Namespace based Segregation&lt;/th&gt;
&lt;th&gt;Virtual Clusters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Isolation&lt;/td&gt;
&lt;td&gt;Hard&lt;/td&gt;
&lt;td&gt;Soft&lt;/td&gt;
&lt;td&gt;Hard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Effective Resource Consumption&lt;/td&gt;
&lt;td&gt;Less&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tenants can use all Native Kubernetes objects&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No. Cluster scoped resources can’t be used&lt;/td&gt;
&lt;td&gt;No. Resources that require underlying node information like DaemonSets can't be used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Availability&lt;/td&gt;
&lt;td&gt;Ready&lt;/td&gt;
&lt;td&gt;Still waiting for General Availability but production-ready.&lt;/td&gt;
&lt;td&gt;Some solutions are available like vCluster but some are still waiting for General Availability like VirtualCluster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Additional overhead on Kubernetes&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;Very Little&lt;/td&gt;
&lt;td&gt;Little to medium as it spins up a new control plane for each mini cluster.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Some use-cases for multi-tenancy in Kubernetes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;SaaS Applications&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Implementation of multi-tenancy can enable organizations to centrally manage the infrastructure for their multiple customers. This makes it easy for SaaS organizations to manage their infrastructure shared among different tenants.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Better Resource Utilization&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fewer clusters will be needed as multiple teams can share a single cluster. Thus, utilizing cluster resources more efficiently. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;To conclude, multi-tenancy is an important aspect of Kubernetes which does not come out of the box, but can be implemented via various strategies. It can extend the usability of Kubernetes, helps to achieve better resource utilization, can save billing costs, and can also be important for the cluster administrators for managing various microservices in an efficient manner.&lt;/p&gt;

&lt;p&gt;That's it folks. Hope you found this article helpful for getting started with multi-tenancy in Kubernetes. Do ask your queries and share your experience via &lt;a href="https://twitter.com/infracloudio"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://static.sched.com/hosted_files/kccnceu19/74/kubecon-eu-multitenancy-wg-deepdive.pdf"&gt;Slide Deck: Deep Dive: Kubernetes WG for Multitenancy - KubeCon EU 2019&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=SUW54Wlx6Po"&gt;Deep Dive: Kubernetes WG for Multitenancy - KubeCon EU 2019&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/kubernetes-sigs/hierarchical-namespaces"&gt;Project HNC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/kubernetes-sigs/cluster-api-provider-nested/tree/main/virtualcluster"&gt;Project VirtualCLuster&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/kubernetes-sigs/cluster-api-provider-nested/blob/main/virtualcluster/doc/vc-icdcs.pdf"&gt;VirtualCLuster Framework&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>cloudnative</category>
      <category>multitenancy</category>
    </item>
    <item>
      <title>Prometheus Definitive Guide Part I - Metrics and Use Cases</title>
      <dc:creator>Deepankur Singh Baliyan</dc:creator>
      <pubDate>Fri, 12 Mar 2021 12:21:32 +0000</pubDate>
      <link>https://forem.com/deepankur797/prometheus-definitive-guide-part-i-metrics-and-use-cases-64k</link>
      <guid>https://forem.com/deepankur797/prometheus-definitive-guide-part-i-metrics-and-use-cases-64k</guid>
      <description>&lt;p&gt;Prometheus is an open source metrics-based monitoring system. It has a multi-dimensional data model and has a strong query language to query that data model. This blog post will discuss monitoring in general and Prometheus from a beginner's point of view. &lt;/p&gt;

&lt;h2&gt;
  
  
  Monitoring in General
&lt;/h2&gt;

&lt;p&gt;Monitoring is a process of collecting, analyzing and displaying useful information about a system. Monitoring should primarily cover: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Alerting:&lt;/em&gt; The primary goal of monitoring is to know when the system fails and generate an alert.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Debugging tools or techniques:&lt;/em&gt; Another goal for monitoring is collecting the information that helps debug a problem or failure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Generating Trends:&lt;/em&gt; The data collected by a monitoring system can be used to generate trends which helps to adapt for the upcoming changes in the system.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prometheus Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ElLZnIOD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://prometheus.io/assets/architecture.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ElLZnIOD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://prometheus.io/assets/architecture.png" alt="Prometheus Architecture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image credit: &lt;a href="https://prometheus.io/assets/architecture.png"&gt;prometheus.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above figure depicts the detailed architecture of Prometheus. It contains one centralized monitoring server (Prometheus). All of the other components like the Alertmanager and Grafana provide extensibility to the main monitoring server. We will divide the architecture into four parts to understand it better.&lt;/p&gt;

&lt;p&gt;The first part is the targets that generate the data. The Data can be exposed to Prometheus through client libraries and exporters. Client libraries can help you create &amp;amp; expose metrics from your application code, and exporters are being used when you can't change the application's source code. Prometheus uses various exporters to monitor third-party applications like an HTTP server or a database. You could find more details about the exposition format in the &lt;a href="https://prometheus.io/docs/instrumenting/exposition_formats/"&gt;Exposition Formats&lt;/a&gt; document.&lt;/p&gt;

&lt;p&gt;The second part is to find the targets and collect the data. Prometheus uses the service discovery mechanism to detect the targets in an environment. It supports integration with EC2, Consul, Kubernetes, and various other platforms to perform service discovery. The process of collecting the metrics is called scraping the targets.&lt;/p&gt;

&lt;p&gt;The third part consists of storage. By default, Prometheus is configured to store data on a local disk. It can also integrate with various types of remote storage solutions for creating a more resilient solution.&lt;/p&gt;

&lt;p&gt;The final part comprises alerting and visualization. The alerting rules can be configured in Prometheus, but a separate component called Alertmanager is needed to manage the alerts. For visualization, You can use PromQL to query the metrics and generate graphs in the Prometheus web UI. Along with these graphs, &lt;a href="https://grafana.com/docs/grafana/latest/dashboards/"&gt;dashboards&lt;/a&gt; can be generated using tools like Grafana.&lt;/p&gt;

&lt;p&gt;There are two ways in which a monitoring solution can collect the metrics — pull-based and push-based. Pull-based is more popular than the latter nowadays, as it doesn’t require any configurational changes in the entities being monitored. Prometheus server itself uses a pull-based mechanism. A push-based metrics collection can be achieved with a component called &lt;a href="https://prometheus.io/docs/instrumenting/pushing/"&gt;Pushgateway&lt;/a&gt;. You could find a brief detail about pull-based vs. push-based &lt;a href="https://prometheus.io/blog/2016/07/23/pull-does-not-scale-or-does-it/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prometheus Metrics and Data Model
&lt;/h2&gt;

&lt;p&gt;Prometheus stores all of its data in time series. Each time series consists of a metric, a unique set of labels, and a value for each timestamp. Metrics are the quantitative measurements of a system property. Labels are the key-value pairs associated with these metrics. Labels enable the filtering and aggregation of metrics through PromQL.&lt;/p&gt;

&lt;p&gt;Deep diving further, metrics can be classified into four categories. To understand the metrics types better, we will be taking an example of a football match. We will define each metric type and then look at an example for it from our match.&lt;/p&gt;

&lt;h4&gt;
  
  
  Counter
&lt;/h4&gt;

&lt;p&gt;For recording a value that is always increasing, a counter type metric gets used. For example, the total number of goals scored in a match. We can use a counter type metric to store it as this value doesn’t decrease.&lt;/p&gt;

&lt;h4&gt;
  
  
  Gauge
&lt;/h4&gt;

&lt;p&gt;For a value that can increment as well as decrement, a gauge metric gets used. For example, possession of a ball in a football match can vary in the range of 0 to 100. It can increase or decrease with time as they play through the game.&lt;/p&gt;

&lt;h4&gt;
  
  
  Histogram
&lt;/h4&gt;

&lt;p&gt;A histogram counts the frequency of occurrences of some sample values. It also provides information regarding the total values observed and their sum. For example, we can use a histogram to calculate how many players have completed the passes less than 10, 20, 30, 40, 50, 60, etc. Note that the 10, 20, 30, 40, 50, 60 series is pre-defined in a histogram.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MetricName&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_bucket{le=10}&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_bucket{le=20}&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_bucket{le=30}&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_bucket{le=40}&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_bucket{le=50}&lt;/td&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_bucket{le=60}&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_bucket{le='Inf'}&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_count&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;player_completed_pass_sum&lt;/td&gt;
&lt;td&gt;790&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  Summary
&lt;/h4&gt;

&lt;p&gt;Summary type is similar to a histogram, as it also counts the frequency over sample values. Additionally, it provides information regarding the total values observed and their sum. Besides this, it adds a label by default to the base metric, i.e., quantile. Quantile tells how many percent values are behind this value. The general quantile which gets assigned to summary ranges from 0 to 1. It is recommended to use summary when you don't have a pre-defined list of buckets. A detailed comparison of Histogram and summary is given &lt;a href="https://prometheus.io/docs/practices/histograms/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Use-cases around Infrastructure Monitoring
&lt;/h3&gt;

&lt;p&gt;So far, we have briefly covered Prometheus and metrics. Before concluding this post, let's have some hands-on experience as well. We will build some use-case around infrastructure monitoring like CPU/memory usage. We will skip the deployment of Prometheus for this post, but you can use a demo instance available &lt;a href="http://demo.robustperception.io:9090/graph"&gt;here&lt;/a&gt;. One can also deploy their own demo instance using this &lt;a href="https://github.com/deepankur797/prometheus-learnings"&gt;Git repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We can query the data stored in Prometheus using PromQL queries. Queries can be executed through the expression browser in the Prometheus web UI. For this part, we will learn the basics while going through these use-cases.&lt;/p&gt;

&lt;h4&gt;
  
  
  CPU Usage
&lt;/h4&gt;

&lt;p&gt;The metric which we are going to use is "node_cpu_seconds_total". This is a counter type metric, and it is used to calculate the seconds for which the CPU is running in a particular mode. CPU has various modes like iowait, idle, user, system, etc. As we are calculating usage, we will drop the idle mode. This is the reason our query looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sum by (cpu)(node_cpu_seconds_total{mode!="idle"})&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;We used the sum function to merge all CPU modes. It results in seconds for which the CPU was running since the beginning, but we need to know whether the CPU was busy or idle recently. To do that, we use the rate function, which calculates the growth rate for a counter.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sum by (cpu)(rate(node_cpu_seconds_total{mode!="idle"}[5m]))*100&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The above-mentioned query will generate the growth rate for the past five minutes to determine how much computing power is being used by the CPU. As all CPU modes add up to 1, we multiplied our query by a hundred to get the result in a percentage.&lt;/p&gt;

&lt;h4&gt;
  
  
  Memory Usage
&lt;/h4&gt;

&lt;p&gt;The following query can calculate the total percentage of used memory:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;node_memory_Active_bytes/node_memory_MemTotal_bytes*100&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is very straightforward and uses the formula of "used divided by total and multiplied by 100".&lt;/p&gt;

&lt;h4&gt;
  
  
  Free Disk
&lt;/h4&gt;

&lt;p&gt;Free disk usage is required to know when you need more space on your infrastructure nodes. Again, we will use the same memory usage approach, but the metric names will get changed.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;node_filesystem_avail_bytes / node_filesystem_size_bytes *100&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In this blog post, we discussed Prometheus and metrics. We looked at its architecture and ran some queries to get us started. In the next post of this Prometheus definitive guide series, we will cover PromQL query language in detail.&lt;br&gt;
Hope you found this article helpful for getting started with Prometheus. Do ask your queries and share your experience via &lt;a href="https://twitter.com/infracloudio"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The official Prometheus documentation. Available at: &lt;a href="https://prometheus.io/"&gt;https://prometheus.io/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Brazil B.(2018) Prometheus: Up &amp;amp; Running. O’Reilly&lt;/li&gt;
&lt;li&gt;The official Prometheus blog available at: &lt;a href="https://prometheus.io/blog/"&gt;https://prometheus.io/blog/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Robust Perception demo installation. Available at: &lt;a href="http://demo.robustperception.io:9090/consoles/index.html"&gt;http://demo.robustperception.io:9090/consoles/index.html&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
  </channel>
</rss>
