Skip to content

Commit

Permalink
Merge pull request #50 from dalehamel/resource-requests-limits
Browse files Browse the repository at this point in the history
fix: Specify resource requests and limits for trace job
  • Loading branch information
leodido committed Jan 28, 2019
2 parents fc5d82c + b5bb5df commit 60d7811
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/tracejob/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/api/resource"
batchv1typed "k8s.io/client-go/kubernetes/typed/batch/v1"
corev1typed "k8s.io/client-go/kubernetes/typed/core/v1"
)
Expand Down Expand Up @@ -255,6 +256,16 @@ func (t *TraceJobClient) CreateJob(nj TraceJob) (*batchv1.Job, error) {
Command: bpfTraceCmd,
TTY: true,
Stdin: true,
Resources: apiv1.ResourceRequirements{
Requests: apiv1.ResourceList{
apiv1.ResourceCPU: resource.MustParse("100m"),
apiv1.ResourceMemory: resource.MustParse("100Mi"),
},
Limits: apiv1.ResourceList{
apiv1.ResourceCPU: resource.MustParse("1"),
apiv1.ResourceMemory: resource.MustParse("1G"),
},
},
VolumeMounts: []apiv1.VolumeMount{
apiv1.VolumeMount{
Name: "program",
Expand Down

0 comments on commit 60d7811

Please sign in to comment.