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

Update Kafka Default Resource to Memory Intensive #1393

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion apis/kubedb/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ var (
},
}

// DefaultResourcesMemoryIntensive must be used for elasticsearch
// DefaultResourcesMemoryIntensive must be used for elasticsearch or kafka
// to avoid OOMKILLED while deploying ES V8
DefaultResourcesMemoryIntensive = core.ResourceRequirements{
Requests: core.ResourceList{
Expand Down
6 changes: 3 additions & 3 deletions apis/kubedb/v1/kafka_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func (k *Kafka) SetDefaults() {

dbContainer := coreutil.GetContainerByName(k.Spec.Topology.Controller.PodTemplate.Spec.Containers, kubedb.KafkaContainerName)
if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) {
apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResources)
apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResourcesMemoryIntensive)
}
}

Expand All @@ -372,7 +372,7 @@ func (k *Kafka) SetDefaults() {

dbContainer := coreutil.GetContainerByName(k.Spec.Topology.Broker.PodTemplate.Spec.Containers, kubedb.KafkaContainerName)
if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) {
apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResources)
apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResourcesMemoryIntensive)
}
}
} else {
Expand All @@ -383,7 +383,7 @@ func (k *Kafka) SetDefaults() {

dbContainer := coreutil.GetContainerByName(k.Spec.PodTemplate.Spec.Containers, kubedb.KafkaContainerName)
if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) {
apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResources)
apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResourcesMemoryIntensive)
}
}
k.SetDefaultEnvs()
Expand Down
2 changes: 1 addition & 1 deletion pkg/license/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func MeetsLicenseRestrictions(kc client.Client, restrictions configapi.LicenseRe
}
restriction, found := restrictions[dbGK.Kind]
if !found {
return false, fmt.Sprintf("Kind is not found in the restrictions map"), nil
return false, "Kind is not found in the restrictions map", nil
}

var dbv unstructured.Unstructured
Expand Down
Loading