Skip to content

Commit

Permalink
Fix annotations propagation to pods (#870)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Makhov <[email protected]>
  • Loading branch information
makhov authored Jan 2, 2025
1 parent a94f884 commit 8b4663a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,18 @@ func (r *ClusterReconciler) addMonitoringStack(kmc *km.Cluster, statefulSet *app
}},
})

statefulSet.Spec.Template.Annotations = map[string]string{
monitoringAnnotations := map[string]string{
"prometheus.io/scrape": "true",
"prometheus.io/port": "8090",
"prometheus.io/path": "/metrics",
}
if statefulSet.Spec.Template.Annotations == nil {
statefulSet.Spec.Template.Annotations = make(map[string]string)
}
for k, v := range monitoringAnnotations {
statefulSet.Spec.Template.Annotations[k] = v
}

statefulSet.Spec.Template.Spec.Volumes = append(statefulSet.Spec.Template.Spec.Volumes, v1.Volume{
Name: kmc.GetMonitoringConfigMapName(),
VolumeSource: v1.VolumeSource{
Expand Down

0 comments on commit 8b4663a

Please sign in to comment.