apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: cloudflare-analytics-exporter
  name: cloudflare-analytics-exporter
  namespace: cloudflare-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cloudflare-analytics-exporter
  template:
    metadata:
      labels:
        app: cloudflare-analytics-exporter
    spec:
      containers:
      - name: cloudflare-analytics-exporter
        image: YOUR_REGISTRY_HERE/cloudflare-analytics-exporter:latest
        imagePullPolicy: Always
        env:
          - name: CF_AUTH_EMAIL
            valueFrom:
              secretKeyRef:
                name: clouflare
                key: CF_AUTH_EMAIL
          - name: CF_AUTH_KEY
            valueFrom:
              secretKeyRef:
                name: clouflare
                key: CF_AUTH_KEY
          - name: CF_GLOBAL_KEY
            valueFrom:
              secretKeyRef:
                name: clouflare
                key: CF_GLOBAL_KEY
          - name: INFLUXDB_PASSWORD
            valueFrom:
              secretKeyRef:
                name: clouflare
                key: INFLUXDB_PASSWORD
        resources:
          limits:
            cpu: 100m
            memory: 64Mi
          requests:
            cpu: 10m
            memory: 8Mi
        volumeMounts:
        - name: config
          mountPath: /app/config.ini
          subPath: config.ini
          readOnly: true  
      nodeSelector:
        agentpool: default
      terminationGracePeriodSeconds: 60
      volumes:
      - name: config
        configMap:
          name: cloudflare-analytics-exporter