Skip to content

Commit

Permalink
Mutate prometheus exporter. (#1187)
Browse files Browse the repository at this point in the history
Signed-off-by: pritamdas99 <pritam@appscode.com>
  • Loading branch information
pritamdas99 authored Apr 1, 2024
1 parent c9359d2 commit 4c457ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions apis/kubedb/v1alpha2/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ const (
ResourcePluralSolr = "solrs"
SolrPortName = "http"
SolrRestPort = 8983
SolrExporterPort = 9854
SolrSecretKey = "solr.xml"
SolrContainerName = "solr"
SolrInitContainerName = "init-solr"
Expand Down
10 changes: 10 additions & 0 deletions apis/kubedb/v1alpha2/solr_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,16 @@ func (s *Solr) SetDefaults(slVersion *catalog.SolrVersion) {
s.setDefaultContainerSecurityContext(slVersion, &s.Spec.PodTemplate)
s.setDefaultContainerResourceLimits(&s.Spec.PodTemplate)
}

if s.Spec.Monitor != nil {
if s.Spec.Monitor.Prometheus == nil {
s.Spec.Monitor.Prometheus = &mona.PrometheusSpec{}
}
if s.Spec.Monitor.Prometheus != nil && s.Spec.Monitor.Prometheus.Exporter.Port == 0 {
s.Spec.Monitor.Prometheus.Exporter.Port = SolrExporterPort
}
s.Spec.Monitor.SetDefaults()
}
}

func (s *Solr) setDefaultContainerSecurityContext(slVersion *catalog.SolrVersion, podTemplate *ofst.PodTemplateSpec) {
Expand Down

0 comments on commit 4c457ff

Please sign in to comment.