Skip to content

Instantly share code, notes, and snippets.

@sebgoa
Last active October 11, 2017 13:44
Show Gist options
  • Save sebgoa/af90cba775bd60b17ecf3e3cd41dbcc7 to your computer and use it in GitHub Desktop.
Save sebgoa/af90cba775bd60b17ecf3e3cd41dbcc7 to your computer and use it in GitHub Desktop.
A Kubernetes cron job that deploys your app continuously
apiVersion: batch/v2alpha1
kind: CronJob
metadata:
name: cookie-app
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: app
image: bitnami/kubecfg:0.5.0
#imagePullPolicy: Never
workingDir: /tmp/cookie/opencompose-jsonnet
env:
- name: TOKEN
valueFrom:
secretKeyRef:
name: default-token-rtw2m
key: token
command: ["kubecfg"]
args:
- --certificate-authority
- /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- --token
- $(TOKEN)
- --server
- https://kubernetes:443
- update
- cookieapp-opencompose.jsonnet
volumeMounts:
- name: cookie
mountPath: /tmp/cookie
restartPolicy: OnFailure
volumes:
- name: cookie
gitRepo:
repository: https://github.com/sebgoa/opencompose-jsonnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment