---
kind: Deployment
apiVersion: apps/v1
metadata:
  namespace: network
  name: cloudflare-ddns
  labels:
    app: cloudflare-ddns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cloudflare-ddns
  template:
    metadata:
      labels:
        app: cloudflare-ddns
      annotations:
        sidecar.istio.io/inject: 'false'
    spec:
      containers:
        - name: cloudflare-ddns
          image: hotio/cloudflareddns:latest
          env:
            - name: CF_APITOKEN
              valueFrom:
                secretKeyRef:
                  name: cloudflare-ddns
                  key: api-token
            - name: CF_ZONES
              valueFrom:
                secretKeyRef:
                  name: cloudflare-ddns
                  key: zones
            - name: CF_HOSTS
              valueFrom:
                secretKeyRef:
                  name: cloudflare-ddns
                  key: hosts
            - name: CF_RECORDTYPES
              valueFrom:
                secretKeyRef:
                  name: cloudflare-ddns
                  key: record-types
            # https://github.com/docker-hotio/docker-cloudflare-ddns#log-levels
            - name: LOG_LEVEL
              value: '3'
            - name: INTERVAL
              value: '300'
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
