diff --git a/CHANGELOG.md b/CHANGELOG.md index 89c0c539b..68857b46b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add `CiliumNetworkPolicy` for all created Prometheuses. +- Always set `shards` to 1 for all created Prometheuses. ## [4.64.0] - 2024-01-19 diff --git a/service/controller/resource/monitoring/prometheus/resource.go b/service/controller/resource/monitoring/prometheus/resource.go index 4256cbbf2..a8720b06f 100644 --- a/service/controller/resource/monitoring/prometheus/resource.go +++ b/service/controller/resource/monitoring/prometheus/resource.go @@ -115,6 +115,7 @@ func toPrometheus(ctx context.Context, v interface{}, config Config) (metav1.Obj // Prometheus default image runs using the nobody user (65534) var gid int64 = 65534 var walCompression bool = true + var prometheusShards int32 = 1 annotationValue := cluster.GetAnnotations()[key.PrometheusVolumeSizeAnnotation] volumeSize := pvcresizing.PrometheusVolumeSize(annotationValue) @@ -229,6 +230,7 @@ func toPrometheus(ctx context.Context, v interface{}, config Config) (metav1.Obj Type: corev1.SeccompProfileTypeRuntimeDefault, }, }, + Shards: &prometheusShards, Storage: &storage, TopologySpreadConstraints: []corev1.TopologySpreadConstraint{ { diff --git a/service/controller/resource/monitoring/prometheus/test/case-1-vintage-mc.golden b/service/controller/resource/monitoring/prometheus/test/case-1-vintage-mc.golden index a59b6a2d0..bcb1d8af1 100644 --- a/service/controller/resource/monitoring/prometheus/test/case-1-vintage-mc.golden +++ b/service/controller/resource/monitoring/prometheus/test/case-1-vintage-mc.golden @@ -98,6 +98,7 @@ spec: matchExpressions: - key: application.giantswarm.io/team operator: DoesNotExist + shards: 1 storage: volumeClaimTemplate: metadata: {} diff --git a/service/controller/resource/monitoring/prometheus/test/case-2-aws-v16.golden b/service/controller/resource/monitoring/prometheus/test/case-2-aws-v16.golden index 481f7c7b8..897f949b0 100644 --- a/service/controller/resource/monitoring/prometheus/test/case-2-aws-v16.golden +++ b/service/controller/resource/monitoring/prometheus/test/case-2-aws-v16.golden @@ -95,6 +95,7 @@ spec: matchExpressions: - key: nonexistentkey operator: Exists + shards: 1 storage: volumeClaimTemplate: metadata: {} diff --git a/service/controller/resource/monitoring/prometheus/test/case-3-aws-v18.golden b/service/controller/resource/monitoring/prometheus/test/case-3-aws-v18.golden index 93d77c0b8..e8d71a8db 100644 --- a/service/controller/resource/monitoring/prometheus/test/case-3-aws-v18.golden +++ b/service/controller/resource/monitoring/prometheus/test/case-3-aws-v18.golden @@ -95,6 +95,7 @@ spec: matchExpressions: - key: nonexistentkey operator: Exists + shards: 1 storage: volumeClaimTemplate: metadata: {} diff --git a/service/controller/resource/monitoring/prometheus/test/case-4-azure-v18.golden b/service/controller/resource/monitoring/prometheus/test/case-4-azure-v18.golden index 0816b5d40..bffd38f22 100644 --- a/service/controller/resource/monitoring/prometheus/test/case-4-azure-v18.golden +++ b/service/controller/resource/monitoring/prometheus/test/case-4-azure-v18.golden @@ -95,6 +95,7 @@ spec: matchExpressions: - key: nonexistentkey operator: Exists + shards: 1 storage: volumeClaimTemplate: metadata: {} diff --git a/service/controller/resource/monitoring/prometheus/test/case-5-eks-v18.golden b/service/controller/resource/monitoring/prometheus/test/case-5-eks-v18.golden index 7460d9e76..1d6f14556 100644 --- a/service/controller/resource/monitoring/prometheus/test/case-5-eks-v18.golden +++ b/service/controller/resource/monitoring/prometheus/test/case-5-eks-v18.golden @@ -95,6 +95,7 @@ spec: matchExpressions: - key: nonexistentkey operator: Exists + shards: 1 storage: volumeClaimTemplate: metadata: {}