apiVersion: apps/v1
kind: Deployment
metadata:
  name: watcher-deployment
  namespace: volume-sync-gcp-k8s
  labels:
    app: watcher
spec:
  selector:
    matchLabels:
      app: watcher
  replicas: 1
  template:
    metadata:
      labels:
        app: watcher
    spec:
      volumes:
        - name: sync-volume
          persistentVolumeClaim:
            claimName: sync-pv-claim
      containers:
        - name: watcher-container
          image: dewaldops/volume-sync-watcher-ch:1.0
          env:
          - name: BASE_DIR
            value: "/mnt/syncdir/"
          - name: INCLUDE_FILE_PATTERN
            valueFrom:
              configMapKeyRef:
                key: INCLUDE_FILE_PATTERN
                name: sync-config
          - name: EXCLUDE_FILE_PATTERN
            valueFrom:
              configMapKeyRef:
                key: EXCLUDE_FILE_PATTERN
                name: sync-config
          - name: BUCKET_NAME
            valueFrom:
              configMapKeyRef:
                key: GCP_BUCKET_NAME
                name: sync-config
          volumeMounts:
            - mountPath: "/mnt"
              name: sync-volume
          resources:
            limits:
              cpu: "0.5"
              memory: "1G"
            requests:
              cpu: "0.2"
              memory: "200M"
