From bb073c621bb193e2b92cfd3f94dea18d52f15c12 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Thu, 25 Jun 2026 16:30:59 +0200 Subject: [PATCH] OCPBUGS-92085: set Prometheus shards value explicitly As explained in https://github.com/prometheus-operator/prometheus-operator/issues/6291, the VPA expects the `.spec.shards` field to be set to an explicit value to scale the resource. Signed-off-by: Simon Pasquier --- assets/prometheus-k8s/prometheus.yaml | 1 + assets/prometheus-user-workload/prometheus.yaml | 1 + jsonnet/components/prometheus-user-workload.libsonnet | 2 ++ jsonnet/components/prometheus.libsonnet | 2 ++ 4 files changed, 6 insertions(+) diff --git a/assets/prometheus-k8s/prometheus.yaml b/assets/prometheus-k8s/prometheus.yaml index a71720aa89..374ddfd457 100644 --- a/assets/prometheus-k8s/prometheus.yaml +++ b/assets/prometheus-k8s/prometheus.yaml @@ -231,6 +231,7 @@ spec: matchLabels: openshift.io/cluster-monitoring: "true" serviceMonitorSelector: {} + shards: 1 thanos: image: "" resources: diff --git a/assets/prometheus-user-workload/prometheus.yaml b/assets/prometheus-user-workload/prometheus.yaml index ed6a7138b3..96530e8ecc 100644 --- a/assets/prometheus-user-workload/prometheus.yaml +++ b/assets/prometheus-user-workload/prometheus.yaml @@ -298,6 +298,7 @@ spec: operator: NotIn values: - "false" + shards: 1 thanos: image: "" resources: diff --git a/jsonnet/components/prometheus-user-workload.libsonnet b/jsonnet/components/prometheus-user-workload.libsonnet index 66600278eb..46059a7d63 100644 --- a/jsonnet/components/prometheus-user-workload.libsonnet +++ b/jsonnet/components/prometheus-user-workload.libsonnet @@ -367,6 +367,8 @@ function(params) value: '15ms', }, ], + // Explicitly set the shards value to 1 to support VPA use cases. + shards: 1, containers: [ { name: 'kube-rbac-proxy-federate', diff --git a/jsonnet/components/prometheus.libsonnet b/jsonnet/components/prometheus.libsonnet index 16c6c8282c..3a304862d8 100644 --- a/jsonnet/components/prometheus.libsonnet +++ b/jsonnet/components/prometheus.libsonnet @@ -403,6 +403,8 @@ function(params) // failures when the WAL replay takes a long time. // See https://issues.redhat.com/browse/OCPBUGS-4168 for details. maximumStartupDurationSeconds: 3600, + // Explicitly set the shards value to 1 to support VPA use cases. + shards: 1, containers: [ { name: 'kube-rbac-proxy-web',