
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mailu-roundcube
  namespace: mailu-mailserver
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: mailu-roundcube
        role: mail
        tier: frontend
    spec:
      containers:
      - name: roundcube
        image: mailu/roundcube:1.5
        imagePullPolicy: Always
        envFrom:
          - configMapRef:
              name: mailu-config
        resources:
          requests:
            memory: 100Mi
            cpu: 100m
          limits:
            memory: 200Mi
            cpu: 200m
        volumeMounts:
          - mountPath: /data
            name: maildata
            subPath: webmail
        ports:
          - containerPort: 80
      volumes:
        - name: maildata
          persistentVolumeClaim:
            claimName: mail-storage
---
apiVersion: v1
kind: Service
metadata:
  name: webmail
  namespace: mailu-mailserver
  labels:
    app: mailu-roundcube
    role: mail
    tier: frontend
spec:
  selector:
    app: mailu-roundcube
    role: mail
    tier: frontend
  ports:
  ports:
  - name: http
    port: 80
    protocol: TCP
