Skip to content

Commit

Permalink
Merge pull request openshift#1630 from slashpai/UWMRetentionSize
Browse files Browse the repository at this point in the history
MON-2193: pkg/manifests: Expose retention size settings for UWM Prometheus
  • Loading branch information
openshift-merge-robot authored Apr 20, 2022
2 parents 21da4f1 + 7b5c35d commit 15724d1
Show file tree
Hide file tree
Showing 4 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 @@ -11,6 +11,7 @@
- [#1598](https://github.com/openshift/cluster-monitoring-operator/pull/1598) Expose Authorization settings for remote write in the CMO configuration
- [#1638](https://github.com/openshift/cluster-monitoring-operator/pull/1638) Expose sigv4 setting to Prometheus remoteWrite
- [#1579](https://github.com/openshift/cluster-monitoring-operator/pull/1579) Expose retention size settings for Platform Prometheus
- [#1630](https://github.com/openshift/cluster-monitoring-operator/pull/1630) Expose retention size settings for UWM Prometheus

## 4.10

Expand Down
1 change: 1 addition & 0 deletions pkg/manifests/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ type UserWorkloadConfiguration struct {
type PrometheusRestrictedConfig struct {
LogLevel string `json:"logLevel"`
Retention string `json:"retention"`
RetentionSize string `json:"retentionSize"`
NodeSelector map[string]string `json:"nodeSelector"`
Tolerations []v1.Toleration `json:"tolerations"`
Resources *v1.ResourceRequirements `json:"resources"`
Expand Down
4 changes: 4 additions & 0 deletions pkg/manifests/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,10 @@ func (f *Factory) PrometheusUserWorkload(grpcTLS *v1.Secret) (*monv1.Prometheus,
p.Spec.Retention = f.config.UserWorkloadConfiguration.Prometheus.Retention
}

if f.config.UserWorkloadConfiguration.Prometheus.RetentionSize != "" {
p.Spec.RetentionSize = f.config.UserWorkloadConfiguration.Prometheus.RetentionSize
}

p.Spec.Image = &f.config.Images.Prometheus

if f.config.UserWorkloadConfiguration.Prometheus.Resources != nil {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ func TestUserWorkloadMonitorPrometheusK8Config(t *testing.T) {
enforcedLabelValueLengthLimit: 600
logLevel: debug
retention: 10h
retentionSize: 15GB
queryLogFile: /tmp/test.log
tolerations:
- operator: "Exists"
Expand Down Expand Up @@ -512,6 +513,7 @@ func TestUserWorkloadMonitorPrometheusK8Config(t *testing.T) {
expectMatchingRequests(podName, containerName, mem, cpu),
expectContainerArg("--log.level=debug", containerName),
expectContainerArg("--storage.tsdb.retention.time=10h", containerName),
expectContainerArg("--storage.tsdb.retention.size=15GB", containerName),
},
),
},
Expand Down

0 comments on commit 15724d1

Please sign in to comment.