From 753fe453738a3d0bfef2566776fb0f7d1493b2f2 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Sat, 16 Oct 2021 18:45:15 +0200
Subject: [PATCH] prometheus: Add memory requests & limits for prometheus

Currently Prometheus is causing some OOM messeages around a node, which
probably originates from the absence of requests and limits. This patch
should fix this problem.
---
 infrastructure/prometheus/release.yaml | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/infrastructure/prometheus/release.yaml b/infrastructure/prometheus/release.yaml
index 72ce1f2f4..d37e3164f 100644
--- a/infrastructure/prometheus/release.yaml
+++ b/infrastructure/prometheus/release.yaml
@@ -523,9 +523,9 @@ spec:
         ## Define resources requests and limits for single Pods.
         ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
         ##
-        resources: {}
-        # requests:
-        #   memory: 400Mi
+        resources:
+         requests:
+           memory: 400Mi
 
         ## Pod anti-affinity can prevent the scheduler from placing Prometheus replicas on the same node.
         ## The default value "soft" means that the scheduler should *prefer* to not schedule two replica pods onto the same node but no guarantee is provided.
@@ -1542,13 +1542,13 @@ spec:
 
       ## Resource limits & requests
       ##
-      resources: {}
-      # limits:
-      #   cpu: 200m
-      #   memory: 200Mi
-      # requests:
-      #   cpu: 100m
-      #   memory: 100Mi
+      resources:
+       limits:
+         cpu: 200m
+         memory: 200Mi
+       requests:
+         cpu: 100m
+         memory: 100Mi
 
       # Required for use in managed kubernetes clusters (such as AWS EKS) with custom CNI (such as calico),
       # because control-plane managed by AWS cannot communicate with pods' IP CIDR and admission webhooks are not working
@@ -2300,8 +2300,10 @@ spec:
         ## Resource limits & requests
         ##
         resources: {}
-        # requests:
-        #   memory: 400Mi
+          requests:
+            memory: 400Mi
+          limits:
+            memory: 1Gi
 
         ## Prometheus StorageSpec for persistent data
         ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/storage.md
-- 
GitLab