apiVersion: apps/v1 
kind: Deployment
metadata:
  namespace: wordpress-stack
  name: mailserver
  labels:
    app.kubernetes.io/name: poste
    app.kubernetes.io/creator: hossein-yousefi
    app.kubernetes.io/stack: wordpress
    app.kubernetes.io/env: production
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: poste
      app.kubernetes.io/creator: hossein-yousefi
      app.kubernetes.io/stack: wordpress
      app.kubernetes.io/env: production
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: poste
      app.kubernetes.io/creator: hossein-yousefi
      app.kubernetes.io/stack: wordpress
      app.kubernetes.io/env: production
  template:
    metadata:
      labels:
        app.kubernetes.io/name: poste
        app.kubernetes.io/creator: hossein-yousefi
        app.kubernetes.io/stack: wordpress
        app.kubernetes.io/env: production
    spec:
      hostname: mail
      containers:
      - image: analogic/poste.io:2
        name: mailserver
        ports:
        - containerPort: 443
        - containerPort: 80 
        - containerPort: 25
        - containerPort: 110
        - containerPort: 143
        - containerPort: 465        
        - containerPort: 587
        - containerPort: 993
        - containerPort: 995
        - containerPort: 4190         
        volumeMounts:
        - name: poste-storage
          mountPath: /data  
        env:
          - name: TZ
            value: Asia/Tehran
          - name: HTTPS
            value: 'OFF'         
      volumes:
      - name: poste-storage
        persistentVolumeClaim:
          claimName: po-pv-claim


