apiVersion: apps/v1
kind: Deployment
metadata:
  name: maestro-broker
spec:
  replicas: 1
  selector:
    matchLabels:
      component: broker
      app: maestro
  template:
    metadata:
      labels:
        component: broker
        app: maestro
    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 1
            preference:
              matchExpressions:
              - key: maestro-node-role
                operator: In
                values:
                - infra
      containers:
      - name: broker
        image: maestroperf/maestro-broker:edge
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /
            port: 8161
          initialDelaySeconds: 5
          timeoutSeconds: 5
          periodSeconds: 20
          failureThreshold: 3
        ports:
        - name: mqtt
          containerPort: 1883
        volumeMounts:
        - mountPath: /opt/maestro/broker/apache-activemq/data
          name: data
        - mountPath: /opt/maestro/broker/apache-activemq/tmp
          name: tmp
      volumes:
      - name: data
        emptyDir: {}
      - name: tmp
        emptyDir: {}

