Skip to content

Commit

Permalink
set limit with request
Browse files Browse the repository at this point in the history
  • Loading branch information
D0m021ng committed Jan 4, 2024
1 parent 48114a0 commit 3370224
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/job/runtime_v2/job/util/kuberuntime/kube_job_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ func (p *PodSpecBuilder) containerResources(container *corev1.Container, request
}
if strings.ToUpper(limitFlavour.Name) == schema.EnvJobLimitFlavourNone {
container.Resources.Limits = nil
} else if limitFlavourResource.CPU() == 0 || limitFlavourResource.Memory() == 0 {
// limit set zero, patch the same value as request
container.Resources.Limits = container.Resources.Requests
} else {
// limit set specified value
container.Resources.Limits = k8s.NewResourceList(limitFlavourResource)
Expand Down

0 comments on commit 3370224

Please sign in to comment.