Skip to content

Commit 2b88a6a

Browse files
authored
Set job resources request and limits (#31)
* Set job resources request and limits Lack of resource limits means that the namespace defaults are used, which might not be enough and cause the jobs to crash. * Set for cockroach-init/cluster-init job
1 parent 5f7ef46 commit 2b88a6a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

base/backup-init-job.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ spec:
7272
- name: cockroachdb-scripts
7373
mountPath: /opt/scripts
7474
readOnly: true
75+
resources:
76+
requests:
77+
cpu: 0
78+
memory: 128Mi
79+
limits:
80+
cpu: 1
81+
memory: 512Mi
7582
restartPolicy: OnFailure
7683
volumes:
7784
- name: client-certs

base/init-job.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ spec:
4848
- "/bin/bash"
4949
- "-c"
5050
- "/cockroach/cockroach init --certs-dir=/cockroach-certs --host=cockroachdb-0.cockroachdb 2>&1 | grep 'initialized'"
51+
resources:
52+
requests:
53+
cpu: 0
54+
memory: 128Mi
55+
limits:
56+
cpu: 1
57+
memory: 512Mi
5158
restartPolicy: OnFailure
5259
volumes:
5360
- name: client-certs

0 commit comments

Comments
 (0)