Skip to content

Instantly share code, notes, and snippets.

@bastjan
Created March 24, 2020 18:27
Show Gist options
  • Save bastjan/83a3dd16c4f1116ef4eda2f713c16106 to your computer and use it in GitHub Desktop.
Save bastjan/83a3dd16c4f1116ef4eda2f713c16106 to your computer and use it in GitHub Desktop.
a cronjob definition for ksonnet/tanka
(import "ksonnet-util/kausal.libsonnet") +
{
local cronJob = $.batch.v1beta1.cronJob,
local container = $.core.v1.container,
hello_container::
container.new("hello", "busybox") +
container.withCommand([
"sh",
"-c",
"echo Chello!",
]),
hello:
cronJob.new(
name="hello",
schedule="* * * * *",
containers=[self.hello_container],
) +
cronJob.mixin.spec.jobTemplate.spec.template.spec.withRestartPolicy("Never")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment