apiVersion: batch/v1 kind: CronJob metadata: name: octodns-cronjob spec: schedule: "0 */2 * * *" successfulJobsHistoryLimit: 1 failedJobsHistoryLimit: 1 jobTemplate: spec: backoffLimit: 1 template: spec: initContainers: - name: git image: git command: ["git"] args: - clone - https://git.kluster.moll.re/remoll/dns.git - /etc/octodns volumeMounts: - name: octodns-config mountPath: /etc/octodns containers: - name: octodns image: octodns env: - name: CLOUDFLARE_ACCOUNT_ID valueFrom: secretKeyRef: name: cloudflare-api key: CLOUDFLARE_ACCOUNT_ID - name: CLOUDFLARE_TOKEN valueFrom: secretKeyRef: name: cloudflare-api key: CLOUDFLARE_TOKEN - name: CLOUDFLARE_EMAIL valueFrom: secretKeyRef: name: cloudflare-api key: CLOUDFLARE_EMAIL command: ["/bin/sh", "-c"] args: - >- pip install -r /etc/octodns/requirements.txt && octodns-sync --config-file /etc/octodns/config.yaml && echo "done" #- --doit volumeMounts: - name: octodns-config mountPath: /etc/octodns volumes: - name: octodns-config emptyDir: {} restartPolicy: Never