OCP: 10. Prometheus & grafana on openshift/kubernetes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
oh and welcome to another open shipped video tutorial in this video I'm going to show how we can't apply Prometheus monitoring on OpenShift and along with the graph on a dashboard so I have my tutorial listed on this repository github.com slash debian master and OpenShift examples to pass three with this let's get started I've already logged in into open ship console with a user called developer and also on the CLI as well so let's go and get started I'm going to switch to open shipped interrupt in fur project on CLI and then so when we deploy Prometheus applic commit this application it runs with a service icon called default and that service account needs to have a cluster builder permission so that it can go in which all the metrics inside open your cluster so I'm going I'm going to give cluster with the permissions to the service account alright that's it and also this is a temporary fix to basically run Prometheus in a with a root user generally we don't prefer to run container cells it would but I mean have much time to work on the customizing the Prometheus per image so I'm going to use this hack for us for this purpose so this basically gives ability to run root containers inside open shipped and this is applicable owns only inside the open shipped in for a project that we see then I'm going to deploy a new application called Jeff honor so this graph on image will be fetched from talker hub and then gets deployed on to open shipped if I go and take a look inside oppressive to ensure project which I don't have access but I can look it on the command line where I've logged in as admin so let me go and apply that right so you can see a new application called Ravana has been deployed this is just another hack I had to put it because the default graph on I image has some issues like when I remove the volume it was working so you may not may not need this always what is just a pack all right and then I'm going to deploy a Prometheus application so this is going to dock hub and then deploy Prometheus docker image and deploy it has an apple image application inside open ship so I got to meet yes and also graph Anna is getting the plot and the one I got already deploy prove it is getting deployed you can see it is in running state now prometheus but was he good parts I have found I Prometheus port running then I need to create a communication from PS config nap this comes in map is the coconut is config map which will which we will mount as a volume inside prometheus container because we need to have the Prometheus configuration loaded the base can be listen to kubernetes cluster and fetch all metrics so if we go take a look inside the consecration map here this just contains all the scrape conflicts like kubernetes node exporter basically looks at the cluster of the equivalent ease and then which is all the data on the mountain data so this is called Prometheus batch cayde-6 config map so I'm going to create this config map so for that I need to use this length the following and then OSI create minus F so contact map has been created and after that this this config map should be mounted as a volume inside Prometheus so this is the command that that does that I can also do it from UI but this is a shortest way so I'm gonna just use this so you can see I'm mounting a volume to with the Prometheus deployment configuration at this location so at C Prometheus location and the file name will become these dot Vimal so that should be it as far as the deployment is concerned or of course we need to configure a graph on this user does not have access to the open shipped in for project so I am going to provide open access all I need to do is OC a DM policy cluster role to user I'm just giving clutter happening through this guy course you do not do it in the real world but just for the sake of simplicity so I'm going to open ship to deposit here and you can see parameters and refine are running and I need to create a routes or Prometheus just to create here you the deforms there you go hit this you can see my project is running and I can you see all the kubernetes routed metrics here you can you can do it from here if you want to see logs but I'm more interested in the fauna interface so I'm going to use trapano here so I've exposed to the fauna URL and then keep the leaf tapana you are the default username is admin and admin and hit create and once you are in graph wanna click on add add to that add data source and then give it as give some name and then in the top down select fill medias and in this URL you need to provide the public URL not the service name and said his name was not working so I guess queue service name yeah and I believe we should not hear the ending trial-like slash I had some issue with that so you can see it works but if you provide slash it will not work so just be careful with that all right so I have added the data source this is my Prometheus data source next thing is I'm I need to go and set up a dashboard so I'm going to click on import here maybe just press i scopes and then you I can do it here or I can just import whatever I have in the repo so can keep on at the input and then we need to paste the dashboard JSON that we have here and it as a JSON that's it and then this is my opening a cluster and the data source for this dashboard is micrognathia city a hitting point i need to be able to see open ship methods coming up here so the you can select individual nodes and if you have a big cluster you can see all those nodes here and then select individual nodes to see how they're performing and and you can see the cluster of ID number usage CPU usage I could not get this file system working but just everything seems to be ok I you can see the part CPU usage you can see the CPU usage by pardoning and also memory usage by pod name so I click on this container memory usage you can see which containers are taking lot of memory so you can see OpenShift origin is taking about 387 megabytes and then spring the application that I have in my so this is doctor running on the prowl part so the the part that is running on this open ship cluster the clematis is taking about 50 MB and the fauna of tool and be the open ship router itself is taking on the column B and then also if I have another application deployed that we throw it here this is a darker related the doctor demon that is running on in post but I am only interested in the parts that I have here which is running instead of consume so it gives a lot of nice information on your existing cluster metrics if you liked the video please give a thumbs up and also share it with with other with your colleagues and also subscribe to this channel thank you very much
Info
Channel: debianmaster
Views: 15,204
Rating: 4.9407406 out of 5
Keywords: docker, kubernetes, prometheus, grafana, monitoring
Id: h0OdaZ-j6YI
Channel Id: undefined
Length: 10min 29sec (629 seconds)
Published: Tue Mar 07 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.