diff --git a/deployment/deployment.yaml b/deployment/deployment.yaml index b09fa4c..c6016e1 100644 --- a/deployment/deployment.yaml +++ b/deployment/deployment.yaml @@ -43,3 +43,27 @@ spec: selector: app: $DEPLOYMENT_NAME type: ClusterIP + + +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: $DEPLOYMENT_NAME +spec: + schedule: "0 0 * * *" + jobTemplate: + spec: + template: + spec: + containers: + - name: $DEPLOYMENT_NAME + image: $IMAGE_NAME + command: ["/bin/bash", "-c"] + args: [ + "/usr/local/gcf1/bin/gcf1dbmng.sh etc urldb_download && \ + /usr/local/gcf1/bin/gcf1dbmng.sh etc urldb_update" + ] + restartPolicy: OnFailure + backoffLimit: 4 + diff --git a/deployment/staging/deployment.yaml b/deployment/staging/deployment.yaml index 8b6cc86..e3d977d 100644 --- a/deployment/staging/deployment.yaml +++ b/deployment/staging/deployment.yaml @@ -40,4 +40,27 @@ spec: targetPort: 3000 selector: app: $DEPLOYMENT_NAME - type: ClusterIP \ No newline at end of file + type: ClusterIP + + +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: $DEPLOYMENT_NAME +spec: + schedule: "0 0 * * *" + jobTemplate: + spec: + template: + spec: + containers: + - name: $DEPLOYMENT_NAME + image: $IMAGE_NAME + command: ["/bin/bash", "-c"] + args: [ + "/usr/local/gcf1/bin/gcf1dbmng.sh etc urldb_download && \ + /usr/local/gcf1/bin/gcf1dbmng.sh etc urldb_update" + ] + restartPolicy: OnFailure + backoffLimit: 4 \ No newline at end of file