apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: email-backend
  name: email-backend
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: email-backend
  template:
    metadata:
      labels:
        io.kompose.service: email-backend
    spec:
      containers:
        - env:
            - name: BOOSTRAP_SERVERS
              valueFrom:
                secretKeyRef:
                  name: kafka-secrets
                  key: BOOSTRAP_SERVERS
            - name: GROUP_ID
              value: email-consumer
            - name: MAIL_HOST
              value: smtp.mailtrap.io
            - name: MAIL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mail-secrets
                  key: MAIL_PASSWORD
            - name: MAIL_PORT
              value: "2525"
            - name: MAIL_USERNAME
              valueFrom:
                secretKeyRef:
                  name: mail-secrets
                  key: MAIL_USERNAME
            - name: SASL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: kafka-secrets
                  key: SASL_PASSWORD
            - name: SASL_USERNAME
              valueFrom:
                secretKeyRef:
                  name: kafka-secrets
                  key: SASL_USERNAME
          image: antoniopapa/email:0.0.1
          name: email-backend
          resources:
            requests:
              cpu: "100m"
              memory: "128Mi"
            limits:
              cpu: "100m"
              memory: "128Mi"

