<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>5. Prometheus in Kubernetes on Prometheus Basics Training</title><link>/docs/05/</link><description>Recent content in 5. Prometheus in Kubernetes on Prometheus Basics Training</description><generator>Hugo</generator><language>en-us</language><atom:link href="/docs/05/index.xml" rel="self" type="application/rss+xml"/><item><title>5.1 Tasks: kube-prometheus metrics</title><link>/docs/05/labs/51/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/05/labs/51/</guid><description>&lt;h3 id="task-511-memory-usage-of-prometheus"&gt;Task 5.1.1: Memory usage of Prometheus&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Task description&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Display the memory usage of both Prometheus pods&lt;/li&gt;
&lt;li&gt;Use a filter to just display metrics from your &lt;code&gt;prometheus&lt;/code&gt; containers&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="alert alert-info" role="alert"&gt;
&lt;h4 class="alert-heading"&gt;Note&lt;/h4&gt;

Search for a metric with &lt;code&gt;memory_working_set&lt;/code&gt; in its name

&lt;/div&gt;

&lt;details data-mode="normalexpertmode" class="normalexpertmode"&gt;
 &lt;summary&gt;Hints&lt;/summary&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-promql" data-lang="promql"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;container_memory_working_set_bytes{namespace&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&amp;#34;&lt;span style="color:#e6db74"&gt;&amp;lt;user&amp;gt;-monitoring&lt;/span&gt;&amp;#34;, pod&lt;span style="color:#f92672"&gt;=~&lt;/span&gt;&amp;#34;&lt;span style="color:#e6db74"&gt;prometheus-prometheus-.*&lt;/span&gt;&amp;#34;, container&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&amp;#34;&lt;span style="color:#e6db74"&gt;prometheus&lt;/span&gt;&amp;#34;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/details&gt;
&lt;h3 id="task-512-kubernetes-pod-count"&gt;Task 5.1.2: Kubernetes pod count&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Task description&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Display how many pods are currently running on your Kubernetes platform&lt;/li&gt;
&lt;/ul&gt;
&lt;details data-mode="normalexpertmode" class="normalexpertmode"&gt;
 &lt;summary&gt;Hints&lt;/summary&gt;
&lt;p&gt;There are different ways to archive this. You can for example query all running containers and group them by &lt;code&gt;pod&lt;/code&gt; and &lt;code&gt;namespace&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>5.2 Tasks: Prometheus Operator</title><link>/docs/05/labs/52/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/05/labs/52/</guid><description>&lt;h3 id="521-prometheus-storage"&gt;5.2.1: Prometheus storage&lt;/h3&gt;
&lt;p&gt;By default, the Prometheus operator stack does not persist the data of the deployed monitoring stack. Therefore, any pod restart would result in a reset of all data. Let&amp;rsquo;s learn about persistence for Prometheus.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Task description&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;See this &lt;a href="https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/storage.md#manual-storage-provisioning" target="_blank" rel="noopener"&gt;example&lt;/a&gt;
 of how to configure storage for Prometheus&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the current values, either look at the file in git or use &lt;code&gt;oc -n $USER-monitoring get prometheus prometheus -oyaml&lt;/code&gt;.&lt;/p&gt;
&lt;details data-mode="normalexpertmode" class="normalexpertmode"&gt;
 &lt;summary&gt;Hints&lt;/summary&gt;
&lt;p&gt;To enable storage for our Prometheus we would simply add the following section to our Prometheus definition.&lt;/p&gt;</description></item></channel></rss>