Install Prometheus and Grafana on AKS Cluster | Configuring a Custom Domain for Grafana on AKS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome back to my channel and in this video I will show you how to install Primitives in grafana inside the kubernetes cluster as well as I will show you how to configure the final dashboard in custom domain URL so you can access grafana dashboard outside the kubernetes cluster so before we proceed let's first understand what is Primitives so Prometheus is a popular time series database designed for monetary and visualizing a matrix in the distributor environment remedies is a open source monitoring system and alert manager that collect a matrix from various sources it is it is widely used by developer and devops team to monitor their application and infrastructure performance and Primitives have a capability to provide a notification in case of any obnerable condition on your application or infrastructure graphana is again grafana is a popular open source for open source platform for visualizing and Performing the data analysis it offer a web-based interface for creating and sharing a dashboard and for your application and infrastructure performance Matrix as well as graphene supporter various data sources like Primitives elasticsearch mongodb SQL and grafana allow user to create a custom workflow and visualization now let's uh jump to the first step installation of Prometheus so here I am going to use a same AKs cluster okay so first let's install the Prometheus so here uh we are going to use a help chart to install the Prometheus and grafana so let me copy the install command so help install release name then Prometheus so let me copy and let me open the terminal and let me paste it now here before that let me first create the namespace so Cube CTN create okay great now let me paste it minus and monitoring namespace and give the name primitius so here I am going to install a Prometheus using a with the name primitius so okay now you can see The Primitives installed successfully so you can see the Primitive server can be accessed via Port 80 and it is successfully installed so now let me quickly open lens software and let me select the monitoring namespace and here you can see The Primitives Primitives is installed now let me first do the put forward so now here you can see The Primitives is now accessible and by default there are predefined metrics are available for example Cube CTL you can take any Matrix so all the kubernetes Matrix are available here for example kubernetes build a info now we have successfully installed The Primitives now the second step is to install the grafana so for that we are going to follow the same step let me copy the install command open the terminal and and let me give the namespace and I am going to install the grafana with the same name grafana yeah now you can see the grafana is installed successfully now uh here first step you see get your admin user user password by running this command so let's first take the password of grafana so yeah so this is our password let me open the lens and here you can see the grafana is installed successfully now let me first do the port forward okay great so username is admin and the password we have to copy from the terminal great now you can see we are able to successfully log into the grafana and if you go here and you can check add new connection and data sources so we need to configure our data sources here so you can configure The Primitives uh influx DB open thdp so there are multiple elastic search low key so there are multiple data sources are available uh primitive sorry MySQL postgresql SQL Server okay so now here either you can create your new dashboard or you can import the dashboard so here I am going to use import dashboard so there are certain readymade dashboards are available where you can directly import the dashboard and you can start your work so here I am going to import the this one K8 view global dashboard so the ID is 15757 so before that I need to First create the data source So currently there is no data sources configured so we need to configure the our Prometheus data source so let me click here select the Prometheus and now here we need a primitive server URL so in the terminal you can see from the in the from the when we install The Primitives let's see the node is the Primitive server can be accessed via Port 80 and the following DNS name within your cluster so we need to copy this okay and we need to paste here http and port 80. so save and test yes okay now go to the home and import dashboard let me take this ID and here I am going to import it so now here you can see we have import a dashboard so you can see here we have a one node six namespaces and 25 ports are running so let's quickly verify we have one node six namespaces and we have a 25 ports are running okay similarly you can see the CPU Direction memory utilization so this it's a ready-made dashboard okay you can directly start uh your work it's a kubernetes specific dashboards Network okay similarly you can uh import a dashboards available in the GitHub and grafana website now you can see now to access this dashboard every time we need to do the port forwarding okay so to avoid this what we have to do we have already created a sample application in last video so our sample application name is AKs demo h2os cloudapp.azure.com right so now we are going to configure our grafana dashboard in this custom domain so we can access without port forward and we can access directly from our website so let me copy this domain name so how to configure it so for that we need to change the grafana config map so open the lens create a config click on config map open this grafana .ini and here we have a domain so let's mention first domain AKs demo h2s.com and okay we have to mention one more property called root URL so let me copy this URL root URL okay it's the same AKs H2S crowdapp asu.com grafana and we have to add this property also okay so from sub path equal to true save and close and we need to restart the grafana okay after that we need to open the Ingress configuration and inside the increase configuration we need to mention our grafana path so here I already mentioned grafana prefix grafana so we need to add this path so we can access grafana dashboard from our website okay so let's quickly check okay so now it's restarted is done let me open this and let me type grafana okay now you can see this grafana dashboard we are going to access from our custom domain so admin and we have to give the password we have to copy the password from terminal login so we have successfully login and oh okay you successfully login and let's open our dashboard so go to the dashboard okay so I think we have not saved this dashboard so let's save it first okay so let's import again or there is no data source okay yeah so we have restart the grafana that's why we lose all the data okay now if you want to persist your data while installing the grafana you need to configure the volumes so once when once you configure the per system volume it will take care it will save your data I have not configured the per system volume that's why I need to configure again so save and test okay now go to dashboard import dashboard and let me load it and import okay so similarly you can configure using the domain now again I will show you so if I restart this graphana port it will we will lose the data because we have not configured the per system volume so to purchase your data you have to configure the per system volume thank you very much see you in the next video
Info
Channel: Nirav Gandhi
Views: 1,745
Rating: undefined out of 5
Keywords: kubernetes monitoring, kubernetes monitoring with prometheus, kubernetes monitoring prometheus grafana, Nirav Gandhi, kubernetes monitoring and alerting, prometheus, devops, kubernetes, kubernetes monitoring tools, kubernetes tutorial for beginners, prometheus monitoring, prometheus monitoring explained, prometheus and grafana, prometheus and grafana installation, prometheus and grafana setup, Configuring a Custom Domain for Grafana, kubernetes monitoring best practices
Id: zn36fenOBzw
Channel Id: undefined
Length: 12min 43sec (763 seconds)
Published: Tue Sep 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.