Skip to content

Instantly share code, notes, and snippets.

@codyzu
Created February 27, 2018 16:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save codyzu/39adb73ea33793cbc8e68a48590ca162 to your computer and use it in GitHub Desktop.
Save codyzu/39adb73ea33793cbc8e68a48590ca162 to your computer and use it in GitHub Desktop.
Kubernetes CronJob publishing to a PubSub topic
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