apiVersion: apps/v1
kind: Deployment
metadata:
  name: maestro-agent
spec:
  replicas: 1
  selector:
    matchLabels:
      component: agent
      app: maestro
  template:
    metadata:
      labels:
        component: agent
        app: maestro
    spec:
#      strategy:
#        type: Recreate
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 1
              preference:
                matchExpressions:
                  - key: maestro-node-role
                    operator: In
                    values:
                      - worker
      containers:
        - name: agent
          image: maestroperf/maestro-agent:edge
          imagePullPolicy: Always
          env:
            - name: MAESTRO_BROKER
              value: mqtt://broker
          volumeMounts:
            - mountPath: /maestro
              name: data
      volumes:
        - name: data
          emptyDir: {}