{"id":3761,"date":"2023-08-24T20:26:28","date_gmt":"2023-08-24T17:26:28","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=3761"},"modified":"2023-08-23T10:42:30","modified_gmt":"2023-08-23T07:42:30","slug":"how-to-deploy-grafana-on-kubernetes","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/","title":{"rendered":"How to Deploy Grafana on Kubernetes"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" data-attachment-id=\"3776\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/attachment\/deploy-grafana-on-kubernetes\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Grafana-on-Kubernetes.png?fit=1920%2C1080&amp;ssl=1\" data-orig-size=\"1920,1080\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Deploy-Grafana-on-Kubernetes\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Grafana-on-Kubernetes.png?fit=750%2C422&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Grafana-on-Kubernetes.png?resize=750%2C422&#038;ssl=1\" alt=\"How to Deploy Grafana on Kubernetes\" class=\"wp-image-3776\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Grafana-on-Kubernetes.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Grafana-on-Kubernetes.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Grafana-on-Kubernetes.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Grafana-on-Kubernetes.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Grafana-on-Kubernetes.png?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This article will walk you through the process of deploying <a href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-prometheus-and-grafana-on-ubuntu\/\">Grafana<\/a> on Kubernetes, specifically using k3s and Helm, and making it accessible via a NodePort on your VPS (Virtual Private Server). We&#8217;ll assume you have k3s and Helm already installed. If not, please refer to their respective official documentation to get started.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/grafana.com\/\" target=\"_blank\" rel=\"noopener\">Grafana<\/a> stands out as a compelling open-source platform that enables users to visualize, analyze and correlate metrics from various data sources in the vast world of observability and monitoring. On the other hand, Kubernetes is a well-known open-source platform that streamlines the deployment, scaling, and management of containerized applications. By offering a reliable solution for monitoring your Kubernetes clusters, deploying Grafana on Kubernetes can significantly improve your DevOps procedures.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/#Prerequisites\" title=\"Prerequisites\">Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/#Step_1_Setting_Up_Helm_Repository\" title=\"Step 1: Setting Up Helm Repository\">Step 1: Setting Up Helm Repository<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/#Step_2_Deploying_Grafana_on_Kubernetes\" title=\"Step 2: Deploying Grafana on Kubernetes\">Step 2: Deploying Grafana on Kubernetes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/#Step_3_Accessing_Grafana_Dashboard\" title=\"Step 3: Accessing Grafana Dashboard\">Step 3: Accessing Grafana Dashboard<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/#Step_4_Customizing_Grafana_on_Kubernetes\" title=\"Step 4: Customizing Grafana on Kubernetes\">Step 4: Customizing Grafana on Kubernetes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/#Step_5_Integrating_Grafana_with_Prometheus\" title=\"Step 5: Integrating Grafana with Prometheus\">Step 5: Integrating Grafana with Prometheus<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/#Final_Thoughts\" title=\"Final Thoughts\">Final Thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before you embark on this journey, ensure that you have the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A Kubernetes cluster running (<a href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-k3s-cluster-and-helm\/\">in this case, k3s<\/a>)<\/li>\n\n\n\n<li>Helm, the package manager for Kubernetes, <a href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-k3s-cluster-and-helm\/\">installed<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.virtono.com\/cloud-vps\">A VPS<\/a> with a public IP address<\/li>\n\n\n\n<li>Basic understanding of Kubernetes and Helm charts<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_1_Setting_Up_Helm_Repository\"><\/span>Step 1: Setting Up Helm Repository<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We must first include the repository for the Grafana Helm chart. Charts are the packaging format that Helm uses. A chart is a collection of documents that list related Kubernetes resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Grafana repository can be added to Helm by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>helm repo add grafana https:\/\/grafana.github.io\/helm-charts<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, update the Helm repositories:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>helm repo update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_2_Deploying_Grafana_on_Kubernetes\"><\/span>Step 2: Deploying Grafana on Kubernetes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we are ready to deploy Grafana. We will use the Helm chart from the repository we added earlier. However, we need Grafana to be accessible from the external IP of our VPS. To achieve this, we need to configure the service type as NodePort in the values file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a file named&nbsp;<code>values.yaml<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>service:\n  type: NodePort<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, deploy Grafana with the custom configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>helm install -f values.yaml grafana grafana\/grafana<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"317\" data-attachment-id=\"3762\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/attachment\/screenshot-2023-08-22-at-12-33-09\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.33.09.png?fit=2012%2C850&amp;ssl=1\" data-orig-size=\"2012,850\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-08-22-at-12.33.09\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.33.09.png?fit=750%2C317&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.33.09.png?resize=750%2C317&#038;ssl=1\" alt=\"How to Deploy Grafana on Kubernetes\" class=\"wp-image-3762\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.33.09.png?resize=1024%2C433&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.33.09.png?resize=300%2C127&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.33.09.png?resize=768%2C324&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.33.09.png?resize=1536%2C649&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.33.09.png?w=2012&amp;ssl=1 2012w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This command will deploy Grafana on the Kubernetes cluster with a NodePort service, which will be accessible from the external IP.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_3_Accessing_Grafana_Dashboard\"><\/span>Step 3: Accessing Grafana Dashboard<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You should go to the Grafana dashboard once it has been deployed. To accomplish this, you must locate the Grafana user&#8217;s admin password. Execute the upcoming command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get secret --namespace default grafana -o jsonpath=\"{.data.admin-password}\" | base64 --decode ; echo<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command decodes the admin password from base64 after retrieving it from the Kubernetes secret.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, retrieve the NodePort assigned to the Grafana service:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>kubectl get svc grafana<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see the NodePort under the &#8220;PORT(S)&#8221; column.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you should be able to access the Grafana dashboard at&nbsp;<code>http:\/\/&lt;EXTERNAL-IP&gt;:&lt;NODEPORT&gt;<\/code>. Use the username&nbsp;<code>admin<\/code>&nbsp;and the password you retrieved earlier to log in.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"67\" data-attachment-id=\"3763\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/attachment\/screenshot-2023-08-22-at-12-39-39\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.39.39.png?fit=1322%2C118&amp;ssl=1\" data-orig-size=\"1322,118\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-08-22-at-12.39.39\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.39.39.png?fit=750%2C67&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.39.39.png?resize=750%2C67&#038;ssl=1\" alt=\"How to Deploy Grafana on Kubernetes\" class=\"wp-image-3763\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.39.39.png?resize=1024%2C91&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.39.39.png?resize=300%2C27&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.39.39.png?resize=768%2C69&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.39.39.png?w=1322&amp;ssl=1 1322w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_4_Customizing_Grafana_on_Kubernetes\"><\/span>Step 4: Customizing Grafana on Kubernetes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For your particular requirements, Grafana deployed in its default configuration might not be adequate. You might want to alter the default admin password, set the persistence, or enable plugins when configuring the Grafana deployment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update your&nbsp;<code>values.yaml<\/code>&nbsp;file with your custom configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>adminPassword: mypassword\npersistence:\n  enabled: true\n  size: 10Gi\nplugins:\n  - grafana-clock-panel\n  - grafana-simple-json-datasource\nservice:\n  type: NodePort<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, upgrade Grafana with the custom configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>helm upgrade -f values.yaml grafana grafana\/grafana<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"272\" data-attachment-id=\"3764\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/attachment\/screenshot-2023-08-22-at-12-46-20\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.46.20.png?fit=2030%2C736&amp;ssl=1\" data-orig-size=\"2030,736\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-08-22-at-12.46.20\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.46.20.png?fit=750%2C272&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.46.20.png?resize=750%2C272&#038;ssl=1\" alt=\"Deploy Grafana on Kubernetes\" class=\"wp-image-3764\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.46.20.png?resize=1024%2C371&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.46.20.png?resize=300%2C109&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.46.20.png?resize=768%2C278&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.46.20.png?resize=1536%2C557&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.46.20.png?w=2030&amp;ssl=1 2030w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_5_Integrating_Grafana_with_Prometheus\"><\/span>Step 5: Integrating Grafana with Prometheus<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Grafana supports many data sources, including Prometheus, a popular open-source monitoring system and time series database. If you have Prometheus running in your Kubernetes cluster, you can integrate it with Grafana.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, add the Prometheus data source in Grafana. Go to the Grafana dashboard, then &#8220;Configuration&#8221; &gt; &#8220;Data Sources&#8221; &gt; &#8220;Add data source.&#8221; Select &#8220;Prometheus&#8221; and fill in the URL of your Prometheus server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you can create a dashboard to visualize the Prometheus metrics. Go to &#8220;Create&#8221; &gt; &#8220;Dashboard&#8221; &gt; &#8220;Add new panel,&#8221; select the Prometheus data source, and start creating your queries.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"348\" data-attachment-id=\"3765\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-grafana-on-kubernetes\/attachment\/screenshot-2023-08-22-at-12-49-33\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?fit=2872%2C1332&amp;ssl=1\" data-orig-size=\"2872,1332\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-08-22-at-12.49.33\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?fit=750%2C348&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?resize=750%2C348&#038;ssl=1\" alt=\"Grafana on Kubernetes\" class=\"wp-image-3765\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?resize=1024%2C475&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?resize=300%2C139&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?resize=768%2C356&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?resize=1536%2C712&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?resize=2048%2C950&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-22-at-12.49.33.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Final_Thoughts\"><\/span>Final Thoughts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Because Grafana provides Helm charts, deploying Grafana on Kubernetes using Helm is a simple procedure. You can keep an eye on your applications and services from any location by making it reachable via a NodePort.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that this is just a starting point for you. Grafana offers a wide range of plugins and data sources, and it is highly customizable. Learn more about Grafana&#8217;s capabilities by perusing the documentation and community.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will walk you through the process of deploying Grafana on Kubernetes, specifically using k3s and Helm, and making it accessible via a NodePort on your VPS (Virtual Private Server). We&#8217;ll assume you have k3s and Helm already installed. If not, please refer to their respective official documentation to<\/p>\n","protected":false},"author":8,"featured_media":3777,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[652,657,653,658,650,656,606,609,659,382,651,655,654],"class_list":["post-3761","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to","tag-deployment-configuration","tag-external-access","tag-grafana-dashboard","tag-grafana-helm-charts","tag-grafana-on-kubernetes","tag-grafana-plugins","tag-helm","tag-k3s","tag-kubernetes-applications","tag-kubernetes-cluster","tag-monitoring-devops","tag-prometheus-data-visualization","tag-vps-nodeport"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/How-to-Deploy-Grafana-on-Kubernetes.png?fit=360%2C240&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-YF","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3695,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-prometheus-on-kubernetes\/","url_meta":{"origin":3761,"position":0},"title":"How to Deploy Prometheus on Kubernetes","author":"George B.","date":"July 30, 2023","format":false,"excerpt":"In this tutorial, we'll discuss how to set up Prometheus on Kubernetes. We'll assume that you've already installed Helm and K3s. If you don't have K3s and Helm installed you can follow our guide. Prometheus has established itself as a top open-source option for monitoring and alerting systems. It is\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/How-to-Deploy-Prometheus-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3708,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-jenkins-on-kubernetes\/","url_meta":{"origin":3761,"position":1},"title":"How to Deploy Jenkins on Kubernetes","author":"George B.","date":"August 2, 2023","format":false,"excerpt":"In this tutorial, we'll go into detail about how to deploy Jenkins on Kubernetes using K3s, a streamlined Kubernetes distribution ideal for edge, IoT, and small clusters. To make the process as clear as possible, this guide will offer specific, step-by-step instructions and examples. Jenkins and Kubernetes have proven to\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/How-to-Deploy-Jenkins-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3821,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-zipkin-on-kubernetes\/","url_meta":{"origin":3761,"position":2},"title":"How to Deploy Zipkin on Kubernetes","author":"George B.","date":"September 6, 2023","format":false,"excerpt":"This tutorial will walk you through setting up Zipkin on Kubernetes, assuming that you already have K3s and Helm set up. Microservices have become a key element in the quickly changing world of software development. Distributed tracing systems like Zipkin have become very popular in tandem with this explosion in\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-Deploy-Zipkin-on-k3s.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3641,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-redis-on-kubernetes\/","url_meta":{"origin":3761,"position":3},"title":"How to Deploy Redis on Kubernetes","author":"George B.","date":"July 25, 2023","format":false,"excerpt":"This article provides a detailed guide on how to install Redis on Kubernetes, covering everything from configuring the Kubernetes environment to installing and administering Redis. The demand for effective, scalable, and trustworthy data storage solutions has increased as the world transitions to microservices and containerized applications. Redis, a high-performance in-memory\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/How-to-Deploy-Redis-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3779,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-nextcloud-on-kubernetes\/","url_meta":{"origin":3761,"position":4},"title":"How to Deploy Nextcloud on Kubernetes","author":"George B.","date":"August 25, 2023","format":false,"excerpt":"This tutorial will walk you through the steps to deploy Nextcloud on Kubernetes cluster using Helm. We'll be using k3s, a lightweight Kubernetes distribution. We'll assume that you've already installed k3s and Helm on your VPS. Nextcloud is a self-hosted cloud storage platform that allows you to store and access\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/08\/Deploy-Nextcloud-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3687,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-deploy-mongodb-on-kubernetes\/","url_meta":{"origin":3761,"position":5},"title":"How to Deploy MongoDB on Kubernetes","author":"George B.","date":"July 29, 2023","format":false,"excerpt":"This tutorial will walk you through installing MongoDB on Kubernetes cluster. We'll assume that you've already got K3s and Helm set up on your machine. The deployment of applications like MongoDB on Kubernetes cluster is made easier by the Kubernetes package manager Helm. Before getting too technical, it's important to\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/07\/How-to-Deploy-MongoDB-on-Kubernetes.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=3761"}],"version-history":[{"count":2,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3761\/revisions"}],"predecessor-version":[{"id":3778,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3761\/revisions\/3778"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/3777"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=3761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=3761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=3761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}