apiVersion: apps/v1
kind: Deployment
metadata:
  name: cuppa-worker
  namespace: cuppa
  labels:
    app: cuppa-worker
spec:
  replicas: 2
  selector:
    matchLabels:
      app: cuppa-worker
  template:
    metadata:
      labels:
        app: cuppa-worker
    spec:
      nodeSelector:
        role: worker
      tolerations:
        - key: workload
          operator: Equal
          value: email-worker
          effect: NoSchedule
      containers:
        - name: worker
          image: ${WORKER_IMAGE}
          imagePullPolicy: Always
          ports:
            - containerPort: 8081
              name: health
          envFrom:
            - configMapRef:
                name: cuppa-config
            - secretRef:
                name: cuppa-secrets
          resources:
            requests:
              cpu: 250m
              memory: 256Mi
            limits:
              cpu: "1"
              memory: 512Mi
          livenessProbe:
            httpGet:
              path: /live
              port: 8081
            initialDelaySeconds: 15
            periodSeconds: 15
