Skip to content

Commit

Permalink
fix(prometheus-storage-config): Fix Prometheus storage config (#140)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Macík <[email protected]>
  • Loading branch information
pmacik authored Dec 17, 2024
1 parent 761c1fa commit 4c69995
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions ci-scripts/rhdh-setup/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,8 @@ setup_monitoring() {
if $cli -n openshift-monitoring get cm cluster-monitoring-config; then
$cli -n openshift-monitoring extract configmap/cluster-monitoring-config --to=- --keys=config.yaml >"$config"
else
cat <<EOD >"$config"
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: ""
EOD
$cli -n openshift-monitoring create configmap cluster-monitoring-config
echo "" >"$config"
fi

update_config=0
Expand All @@ -497,7 +490,7 @@ EOD
fi

if [ "$(yq '.prometheusK8s.volumeClaimTemplate' "$config")" == "null" ]; then
yq -i '.prometheusK8s = {"volumeClaimTemplate":{"spec":{"storageClassName":"gp3-csi","volumeMode":"Filesystem","resources":{"requests":{"storage":"50Gi"}}}}}' "$config"
yq -i '.prometheusK8s = {"volumeClaimTemplate":{"spec":{"storageClassName":"gp3-csi","volumeMode":"Filesystem","resources":{"requests":{"storage":"30Gi"}}}}}' "$config"
update_config=1
fi

Expand Down Expand Up @@ -533,15 +526,8 @@ EOD
if $cli -n openshift-user-workload-monitoring get cm user-workload-monitoring-config; then
$cli -n openshift-user-workload-monitoring extract configmap/user-workload-monitoring-config --to=- --keys=config.yaml >"$config"
else
cat <<EOD >"$config"
apiVersion: v1
kind: ConfigMap
metadata:
name: user-workload-monitoring-config
namespace: openshift-user-workload-monitoring
data:
config.yaml: ""
EOD
$cli -n openshift-user-workload-monitoring create configmap user-workload-monitoring-config
echo "" >"$config"
fi

if [ "$(yq '.prometheus.volumeClaimTemplate' "$config")" == "null" ]; then
Expand Down

0 comments on commit 4c69995

Please sign in to comment.