Skip to content

Commit

Permalink
Merge pull request #2988 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2969-to-release-4.18

DFBUGS-1272:[release-4.18] Add node toleration to alertmanager and prometheus pods
  • Loading branch information
openshift-merge-bot[bot] authored Jan 29, 2025
2 parents 19d9fa2 + 1c90d8c commit 3eeeb26
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions templates/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ package templates
import (
promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/red-hat-storage/ocs-operator/v4/controllers/defaults"
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/ptr"
)

var AlertmanagerSpecTemplate = promv1.AlertmanagerSpec{
Replicas: ptr.To(int32(1)),
Resources: defaults.MonitoringResources["alertmanager"],
Tolerations: []corev1.Toleration{{
Key: defaults.NodeTolerationKey,
Operator: corev1.TolerationOpEqual,
Value: "true",
Effect: corev1.TaintEffectNoSchedule,
}},
}
6 changes: 6 additions & 0 deletions templates/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ var PrometheusSpecTemplate = promv1.PrometheusSpec{
},
},
},
Tolerations: []corev1.Toleration{{
Key: defaults.NodeTolerationKey,
Operator: corev1.TolerationOpEqual,
Value: "true",
Effect: corev1.TaintEffectNoSchedule,
}},
},
RuleSelector: &ruleSelector,
EnableAdminAPI: false,
Expand Down

0 comments on commit 3eeeb26

Please sign in to comment.