-
-
Save cdock1029/6465aa11f0f935d24eac0d40e203c44f to your computer and use it in GitHub Desktop.
Kubernetes CronJob publishing to a PubSub topic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: monthly-late-fee-rent | |
spec: | |
schedule: "0 6 1 * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: | |
containers: | |
- name: monthly-late-fee-rent | |
image: google/cloud-sdk:183.0.0-slim | |
args: | |
- /bin/sh | |
- -c | |
- gcloud beta pubsub topics publish monthly-late-fee-rent-job --message="{\"lastMonth\": $(date --date='last month' +%-m), \"thisMonth\": $(date +%-m)}" | |
restartPolicy: OnFailure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment