Skip to content

Commit

Permalink
Use memory intensive resrouce for druid coordinator
Browse files Browse the repository at this point in the history
Signed-off-by: raihankhan <[email protected]>
  • Loading branch information
raihankhan committed Feb 9, 2024
1 parent fce8d11 commit bb62c90
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions apis/kubedb/v1alpha2/druid_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func (d *Druid) SetDefaults() {
}
d.setDefaultContainerSecurityContext(&druidVersion, &d.Spec.Topology.Coordinators.PodTemplate)
d.setDefaultInitContainerSecurityContext(&druidVersion, &d.Spec.Topology.Coordinators.PodTemplate)
d.setDefaultContainerResourceLimits(&d.Spec.Topology.Coordinators.PodTemplate)
d.setCoordinatorsDefaultContainerResourceLimits(&d.Spec.Topology.Coordinators.PodTemplate)
}
}
if d.Spec.Topology.Overlords != nil {
Expand Down Expand Up @@ -465,10 +465,12 @@ func (d *Druid) setDefaultContainerResourceLimits(podTemplate *ofst.PodTemplateS
if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) {
apis.SetDefaultResourceLimits(&dbContainer.Resources, DefaultResources)
}
}

initContainer := coreutil.GetContainerByName(podTemplate.Spec.InitContainers, DruidInitContainerName)
if initContainer != nil && (initContainer.Resources.Requests == nil && initContainer.Resources.Limits == nil) {
apis.SetDefaultResourceLimits(&initContainer.Resources, DefaultInitContainerResource)
func (d *Druid) setCoordinatorsDefaultContainerResourceLimits(podTemplate *ofst.PodTemplateSpec) {
dbContainer := coreutil.GetContainerByName(podTemplate.Spec.Containers, DruidContainerName)
if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) {
apis.SetDefaultResourceLimits(&dbContainer.Resources, DefaultResourcesMemoryIntensive)
}
}

Expand Down

0 comments on commit bb62c90

Please sign in to comment.