Skip to content

Commit

Permalink
Always set shards to 1 for all created Prometheuses (#1494)
Browse files Browse the repository at this point in the history
Co-authored-by: Herve Nicol <[email protected]>
  • Loading branch information
hervenicol and hervenicol authored Jan 30, 2024
1 parent cde5846 commit 4c6457b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions service/controller/resource/monitoring/prometheus/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ spec:
matchExpressions:
- key: application.giantswarm.io/team
operator: DoesNotExist
shards: 1
storage:
volumeClaimTemplate:
metadata: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ spec:
matchExpressions:
- key: nonexistentkey
operator: Exists
shards: 1
storage:
volumeClaimTemplate:
metadata: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ spec:
matchExpressions:
- key: nonexistentkey
operator: Exists
shards: 1
storage:
volumeClaimTemplate:
metadata: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ spec:
matchExpressions:
- key: nonexistentkey
operator: Exists
shards: 1
storage:
volumeClaimTemplate:
metadata: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ spec:
matchExpressions:
- key: nonexistentkey
operator: Exists
shards: 1
storage:
volumeClaimTemplate:
metadata: {}
Expand Down

0 comments on commit 4c6457b

Please sign in to comment.