Skip to content

Commit b3d1563

Browse files
committed
Add resources for ope-notebook-culler cronjob
File formatting to make git happy Formatting
1 parent 0e03a05 commit b3d1563

File tree

5 files changed

+60
-1
lines changed

5 files changed

+60
-1
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: batch/v1
2+
kind: CronJob
3+
metadata:
4+
name: ope-notebook-culler
5+
namespace: rhods-notebooks
6+
spec:
7+
successfulJobsHistoryLimit: 7
8+
failedJobsHistoryLimit: 7
9+
schedule: "0 7 */2 * *"
10+
jobTemplate:
11+
spec:
12+
template:
13+
metadata:
14+
name: ope-notebook-culler
15+
spec:
16+
serviceAccountName: ope-notebook-culler
17+
containers:
18+
- name: ope-notebook-culler
19+
resources:
20+
limits:
21+
cpu: '.1'
22+
memory: 100M
23+
requests:
24+
cpu: '.1'
25+
memory: 100M
26+
image: ghcr.io/ocp-on-nerc/bu-rhoai:toolkit
27+
imagePullPolicy: Always
28+
env:
29+
- name: POD_NS
30+
valueFrom:
31+
fieldRef:
32+
fieldPath: metadata.namespace
33+
command:
34+
- "/bin/sh"
35+
- "-ec"
36+
- "./ope-notebook-culler.sh"
37+
restartPolicy: OnFailure
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- cronjob.yaml
5+
- rolebinding.yaml
6+
- serviceaccount.yaml
7+
namespace: rhods-notebooks
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
kind: RoleBinding
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
metadata:
4+
name: ope-notebook-culler
5+
subjects:
6+
- kind: ServiceAccount
7+
name: ope-notebook-culler
8+
roleRef:
9+
apiGroup: rbac.authorization.k8s.io
10+
kind: ClusterRole
11+
name: edit
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: ope-notebook-culler

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM quay.io/operate-first/opf-toolbox:v0.8.0
22
WORKDIR /shell-scripts
33
COPY src/* /shell-scripts
4-
CMD ["/bin/sh"]
4+
CMD ["/bin/sh"]

0 commit comments

Comments
 (0)