Skip to content

Commit

Permalink
Add resources for ope-notebook-culler cronjob
Browse files Browse the repository at this point in the history
File formatting to make git happy

Formatting
  • Loading branch information
dystewart committed Jan 18, 2024
1 parent 0e03a05 commit 9952d9c
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
37 changes: 37 additions & 0 deletions cronjobs/ope-notebook-culler/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: ope-notebook-culler
namespace: rhods-notebooks
spec:
successfulJobsHistoryLimit: 7
failedJobsHistoryLimit: 1
schedule: "0 3 * * *"
jobTemplate:
spec:
template:
metadata:
name: ope-notebook-culler
spec:
serviceAccountName: ope-notebook-culler
containers:
- name: ope-notebook-culler
resources:
limits:
cpu: '2'
memory: 8Gi
requests:
cpu: '1'
memory: 8Gi
image: ghcr.io/ocp-on-nerc/bu-rhoai:toolkit
imagePullPolicy: Always
env:
- name: POD_NS
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- "/bin/sh"
- "-ec"
- "./ope-notebook-culler.sh"
restartPolicy: OnFailure
7 changes: 7 additions & 0 deletions cronjobs/ope-notebook-culler/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cronjob.yaml
- rolebinding.yaml
- serviceaccount.yaml
namespace: rhods-notebooks
11 changes: 11 additions & 0 deletions cronjobs/ope-notebook-culler/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ope-notebook-culler
subjects:
- kind: ServiceAccount
name: ope-notebook-culler
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: edit
4 changes: 4 additions & 0 deletions cronjobs/ope-notebook-culler/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: ope-notebook-culler
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/operate-first/opf-toolbox:v0.8.0
WORKDIR /shell-scripts
COPY src/* /shell-scripts
CMD ["/bin/sh"]
CMD ["/bin/sh"]

0 comments on commit 9952d9c

Please sign in to comment.