<?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</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">Task 5.1.1: Memory usage of Prometheus&lt;/h3>
&lt;p>&lt;strong>Task description&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>Display the memory usage of both Prometheus pods&lt;/li>
&lt;li>Use a filter to just display metrics from your &lt;code>prometheus&lt;/code> containers&lt;/li>
&lt;/ul>
&lt;p>Use the [Thanos Querier web UI](https://&amp;lt;user&amp;gt;-thanos-query.training.cluster.acend.ch to execute the queries.&lt;/p>


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

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

&lt;/div>

&lt;details data-mode="normalexpertmode" class="normalexpertmode">
 &lt;summary>Hints&lt;/summary>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-promql" data-lang="promql">&lt;span style="display:flex;">&lt;span>container_memory_working_set_bytes{pod&lt;span style="color:#f92672">=~&lt;/span>&amp;#34;&lt;span style="color:#e6db74">prometheus-prometheus-0&lt;/span>&amp;#34;, container&lt;span style="color:#f92672">=&lt;/span>&amp;#34;&lt;span style="color:#e6db74">prometheus&lt;/span>&amp;#34;,namespace&lt;span style="color:#f92672">=~&lt;/span>&amp;#34;&lt;span style="color:#e6db74">&amp;lt;user&amp;gt;.*&lt;/span>&amp;#34;}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/details>
&lt;h3 id="task-512-kubernetes-pod-count">Task 5.1.2: Kubernetes pod count&lt;/h3>
&lt;p>&lt;strong>Task description&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>Display how many pods are currently running on your Kubernetes platform&lt;/li>
&lt;/ul>
&lt;details data-mode="normalexpertmode" class="normalexpertmode">
 &lt;summary>Hints&lt;/summary>
&lt;p>There are different ways to archive this. You can for example query all running containers and group them by &lt;code>pod&lt;/code> and &lt;code>namespace&lt;/code>.&lt;/p></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">5.2.1: Prometheus storage&lt;/h3>
&lt;p>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>
&lt;p>&lt;strong>Task description&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>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">example&lt;/a>
 of how to configure storage for Prometheus&lt;/li>
&lt;/ul>
&lt;p>To get the current values, either look at the file in git or use &lt;code>kubectl -n $USER-monitoring get prometheus prometheus -oyaml&lt;/code>.&lt;/p>
&lt;details data-mode="normalexpertmode" class="normalexpertmode">
 &lt;summary>Hints&lt;/summary>
&lt;p>To enable storage for our Prometheus we would simply add the following section to our Prometheus definition.&lt;/p></description></item></channel></rss>