Skip to content

Commit

Permalink
Merge pull request #2251 from simonpasquier/use-maximumStartupDuratio…
Browse files Browse the repository at this point in the history
…nSeconds

MON-3697: use `maximumStartupDurationSeconds` instead of container patch
  • Loading branch information
openshift-merge-bot[bot] committed Feb 1, 2024
2 parents 615f8a9 + b9171b4 commit 1bbf0f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions assets/prometheus-k8s/prometheus.yaml
Expand Up @@ -164,6 +164,7 @@ spec:
externalURL: https://prometheus-k8s.openshift-monitoring.svc:9091
image: quay.io/prometheus/prometheus:v2.49.1
listenLocal: true
maximumStartupDurationSeconds: 3600
nodeSelector:
kubernetes.io/os: linux
podMetadata:
Expand Down
4 changes: 4 additions & 0 deletions jsonnet/components/prometheus.libsonnet
Expand Up @@ -382,6 +382,10 @@ function(params)
value: '15ms',
},
],
// Increase the startup probe timeout to 1h from 15m to avoid restart
// failures when the WAL replay takes a long time.
// See https://issues.redhat.com/browse/OCPBUGS-4168 for details.
maximumStartupDurationSeconds: 3600,
containers: [
{
name: 'prometheus-proxy',
Expand Down
10 changes: 0 additions & 10 deletions pkg/manifests/manifests.go
Expand Up @@ -1483,16 +1483,6 @@ func (f *Factory) PrometheusK8s(grpcTLS *v1.Secret, trustedCABundleCM *v1.Config

for i, container := range p.Spec.Containers {
switch container.Name {
case "prometheus":
// Increase the startup probe timeout to 1h from 15m to avoid restart failures when the WAL replay
// takes a long time. See https://issues.redhat.com/browse/OCPBUGS-4168 for details.
// TODO (JoaoBraveCoding): Once prometheus-operator adds CRD support to configure startupProbe directly
// we should use that instead of using strategic merge patch
// See https://github.com/prometheus-operator/prometheus-operator/issues/4730
p.Spec.Containers[i].StartupProbe = &v1.Probe{
PeriodSeconds: 15,
FailureThreshold: 240,
}
case "prometheus-proxy":
p.Spec.Containers[i].Image = f.config.Images.OauthProxy

Expand Down

0 comments on commit 1bbf0f0

Please sign in to comment.