apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: dyndns
spec:
  schedule: "*/5 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: doddns
              image: thepiconerd/digitaloceandyndns
              env:
                - name: CONFIGFILE
                  value: /data/config.yaml
                - name: API_KEY
                  valueFrom:
                    secretKeyRef:
                      name: digitalocean
                      key: apiKey
              volumeMounts:
                - name: config
                  mountPath: /data/
          restartPolicy: OnFailure
          volumes:
            - name: config
              configMap:
                name: doddns-config