apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mailu-fetchmail
  namespace: mailu-mailserver
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: mailu-fetchmail
        role: mail
        tier: backend
    spec:
      containers:
      - name: fetchmail
        image: mailu/fetchmail:master
        imagePullPolicy: Always
        envFrom:
          - configMapRef:
              name: mailu-config
        volumeMounts:
          - name: maildata
            mountPath: /data
            subPath: maildata
        ports:
          - containerPort: 5232
          - containerPort: 80
        resources:
          requests:
            memory: 100Mi
            cpu: 100m
          limits:
            memory: 100Mi
            cpu: 100m
      volumes:
        - name: maildata
          persistentVolumeClaim:
            claimName: mail-storage