Created
February 27, 2018 16:53
-
-
Save codyzu/39adb73ea33793cbc8e68a48590ca162 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: every-5-minutes | |
spec: | |
schedule: "*/5 * * * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: | |
containers: | |
- name: gcloud-publish-every-5-minutes | |
image: google/cloud-sdk:183.0.0-slim | |
args: | |
- /bin/sh | |
- -c | |
- gcloud beta pubsub topics publish cron-every-5-minutes --message="run cron" | |
restartPolicy: OnFailure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment