---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: adguard-config-sync
  namespace: home-network
spec:
  replicas: 1
  selector:
    matchLabels:
      app: adguard-config-sync
  template:
    metadata:
      labels:
        app: adguard-config-sync
    spec:
      containers:
        - name: adguard-sync-to-secondary
          image: ghcr.io/bakito/adguardhome-sync:v0.4.3
          command: ["/opt/go/adguardhome-sync"]
          args: ["run"]
          env:
            - name: ORIGIN_URL
              value: http://adguard-home:3000
            - name: ORIGIN_USERNAME
              value: ${SECRET_ADGUARD_USERNAME}
            - name: ORIGIN_PASSWORD
              value: ${SECRET_ADGUARD_PASSWORD}
            - name: REPLICA_URL
              value: http://adguard-home-replica:3000
            - name: REPLICA_USERNAME
              value: ${SECRET_ADGUARD_USERNAME}
            - name: REPLICA_PASSWORD
              value: ${SECRET_ADGUARD_PASSWORD}
            - name: RUNONSTART
              value: "true"
            - name: CRON
              value: "*/10 * * * *"
          resources:
            requests:
              memory: 100Mi
              cpu: 100m
            limits:
              memory: 200Mi
              cpu: 500m
