Skip to content

Commit 1abaef2

Browse files
committed
fix(reprocessing-worker): fixes
1 parent ff30d4d commit 1abaef2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

admin/k8s_client.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"context"
77
"encoding/json"
88
"fmt"
9+
"math"
910
"os"
1011
"sort"
1112
"strings"
@@ -16,6 +17,7 @@ import (
1617
batchv1 "k8s.io/api/batch/v1"
1718
v1 "k8s.io/api/core/v1"
1819
"k8s.io/apimachinery/pkg/api/errors"
20+
"k8s.io/apimachinery/pkg/api/resource"
1921
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2022
"k8s.io/client-go/kubernetes"
2123
"k8s.io/client-go/rest"
@@ -295,6 +297,7 @@ func (k *K8sJobClient) buildIndexedJob(jobName, filesConfigMapName, jobConfigMap
295297
"job-id": jobID,
296298
},
297299
},
300+
298301
Spec: v1.PodSpec{
299302
RestartPolicy: v1.RestartPolicyOnFailure,
300303
NodeSelector: nodeSelector,
@@ -337,6 +340,16 @@ func (k *K8sJobClient) buildIndexedJob(jobName, filesConfigMapName, jobConfigMap
337340
},
338341
},
339342
},
343+
Resources: v1.ResourceRequirements{
344+
Limits: v1.ResourceList{
345+
v1.ResourceCPU: *resource.NewMilliQuantity(int64(1000), resource.DecimalSI),
346+
v1.ResourceMemory: *resource.NewQuantity(int64(math.Pow(2, 31)), resource.BinarySI),
347+
},
348+
Requests: v1.ResourceList{
349+
v1.ResourceCPU: *resource.NewMilliQuantity(int64(310), resource.DecimalSI),
350+
v1.ResourceMemory: *resource.NewQuantity(int64(math.Pow(2, 30)), resource.BinarySI),
351+
},
352+
},
340353
VolumeMounts: []v1.VolumeMount{
341354
{
342355
Name: "file-list",

0 commit comments

Comments
 (0)