From 45f90058ecdc27581d5520958195a74a54c9f9c4 Mon Sep 17 00:00:00 2001 From: Camil Blanaru Date: Fri, 29 Dec 2017 18:37:21 +0200 Subject: [PATCH] Allow changing the size or requested memory. --- deploy | 9 +++++++++ manifests/prometheus/prometheus-k8s.yaml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/deploy b/deploy index b7bd9e3..32b8077 100755 --- a/deploy +++ b/deploy @@ -8,6 +8,7 @@ PROMETHEUS_DEFAULT_VERSION=v2.0.0 PROMETHEUS_OPERATOR_DEFAULT_VERSION=v0.15.0 PROMETHEUS_STORAGE_DEFAULT_RETENTION=168h PROMETHEUS_STORAGE_DEFAULT_VOLUME_SIZE=40Gi +PROMETHEUS_DEFAULT_MEMORY_REQUEST=1Gi ALERTMANAGER_DEFAULT_VERSION=v0.12.0 NODE_EXPORTER_DEFAULT_VERSION=v0.15.2 KUBE_STATE_METRICS_DEFAULT_VERSION=v1.1.0 @@ -118,6 +119,11 @@ echo read -p "Enter Prometheus storage volume size [$PROMETHEUS_STORAGE_DEFAULT_VOLUME_SIZE]: " PROMETHEUS_STORAGE_VOLUME_SIZE PROMETHEUS_STORAGE_VOLUME_SIZE=${PROMETHEUS_STORAGE_VOLUME_SIZE:-$PROMETHEUS_STORAGE_DEFAULT_VOLUME_SIZE} +#Prometheus Memory Request +echo +read -p "Enter Prometheus memory request in Gi or Mi [$PROMETHEUS_DEFAULT_MEMORY_REQUEST]: " PROMETHEUS_MEMORY_REQUEST +PROMETHEUS_MEMORY_REQUEST=${PROMETHEUS_MEMORY_REQUEST:-$PROMETHEUS_DEFAULT_MEMORY_REQUEST} + #Grafana echo read -p "Enter Grafana version [$GRAFANA_DEFAULT_VERSION]: " GRAFANA_VERSION @@ -160,6 +166,9 @@ sed -i -e 's/PROMETHEUS_STORAGE_RETENTION/'"$PROMETHEUS_STORAGE_RETENTION"'/g' m #set prometheus storage volume size sed -i -e 's/PROMETHEUS_STORAGE_VOLUME_SIZE/'"$PROMETHEUS_STORAGE_VOLUME_SIZE"'/g' manifests/prometheus/prometheus-k8s.yaml +#set prometheus memory request +sed -i -e 's/PROMETHEUS_MEMORY_REQUEST/'"$PROMETHEUS_MEMORY_REQUEST"'/g' manifests/prometheus/prometheus-k8s.yaml + #set grafana version sed -i -e 's/GRAFANA_VERSION/'"$GRAFANA_VERSION"'/g' manifests/grafana/grafana.de.yaml diff --git a/manifests/prometheus/prometheus-k8s.yaml b/manifests/prometheus/prometheus-k8s.yaml index 65e41da..1af0398 100644 --- a/manifests/prometheus/prometheus-k8s.yaml +++ b/manifests/prometheus/prometheus-k8s.yaml @@ -39,7 +39,7 @@ spec: requests: storage: PROMETHEUS_STORAGE_VOLUME_SIZE requests: - memory: 2Gi + memory: PROMETHEUS_MEMORY_REQUEST alerting: alertmanagers: - namespace: monitoring