Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node toleration to alertmanager and prometheus pods #2969

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add node toleration to alertmanager and prometheus pods
Signed-off-by: Rohan Gupta <rohgupta@redhat.com>
rohan47 committed Jan 17, 2025
commit 7081f43c527c5056831c90e10c8f0d1e0a3b5ff8
7 changes: 7 additions & 0 deletions templates/alertmanager.go
Original file line number Diff line number Diff line change
@@ -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
@@ -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,