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

apiVersion: v1
kind: Service
metadata:
  name: admin
  namespace: mailu-mailserver
  labels:
    app: mailu-admin
    role: mail
    tier: backend
spec:
  selector:
    app: mailu-admin
    role: mail
    tier: backend
  ports:
  - name: http
    port: 80
    protocol: TCP