Skip to content

Commit

Permalink
Packaged invoice container into Kubernetes cronjob
Browse files Browse the repository at this point in the history
The manifests needed for the cronjob includes the cronjob, and two secret files which sets the private key for the nonbillable repo's deploykey and the s3 app_key and key_id
The cronjob is set to run at 12:00AM on the 1st of each month
  • Loading branch information
QuanMPhm committed May 8, 2024
1 parent cd231b4 commit 5198854
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
30 changes: 30 additions & 0 deletions k8/base/invoice-processing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: invoice-processing
spec:
schedule: "0 14 1 * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: invoice-processing
image: ghcr.io/cci-moc/process-csv-report:latest
env:
- name: GH_NONBILLABLE_DEPLOYKEY
valueFrom:
secretKeyRef:
name: gh-nonbillables
key: ssh-deploykey
- name: S3_KEY_ID
valueFrom:
secretKeyRef:
name: nerc-invoices-s3-bucket
key: s3-key-id
- name: S3_APP_KEY
valueFrom:
secretKeyRef:
name: nerc-invoices-s3-bucket
key: s3-app-key
restartPolicy: OnFailure
2 changes: 2 additions & 0 deletions k8/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- invoice-processing.yaml
7 changes: 7 additions & 0 deletions k8/overlay/gh-nonbillables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: gh-nonbillables
type: kubernetes.io/ssh-auth
data:
ssh-deploykey: test
4 changes: 4 additions & 0 deletions k8/overlay/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- ../base
- secret-b2-old-pi.yaml
- secret-gh-nonbillables.yaml
8 changes: 8 additions & 0 deletions k8/overlay/nerc-invoices-s3-bucket.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: nerc-invoices-s3-bucket
type: Opaque
data:
s3-app-key: test
s3-key-id: test

0 comments on commit 5198854

Please sign in to comment.