apiVersion: apps/v1
kind: Deployment
metadata:
  name: mailpit
  namespace: bytelyst-infra
  labels:
    app: mailpit
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mailpit
  template:
    metadata:
      labels:
        app: mailpit
    spec:
      containers:
      - name: mailpit
        image: axllent/mailpit:latest
        ports:
        - containerPort: 1025
          name: smtp
        - containerPort: 8025
          name: ui
        resources:
          requests:
            cpu: "50m"
            memory: "64Mi"
          limits:
            cpu: "200m"
            memory: "128Mi"
        readinessProbe:
          httpGet:
            path: /
            port: 8025
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: mailpit
  namespace: bytelyst-infra
spec:
  selector:
    app: mailpit
  ports:
  - name: smtp
    port: 1025
    targetPort: 1025
  - name: ui
    port: 8025
    targetPort: 8025
---
apiVersion: v1
kind: Service
metadata:
  name: mailpit-external
  namespace: bytelyst-infra
spec:
  type: NodePort
  selector:
    app: mailpit
  ports:
  - name: ui
    port: 8025
    targetPort: 8025
    nodePort: 8025
