apiVersion: apps/v1
kind: Deployment
metadata:
  name: locust-slave
spec:
  selector:
    matchLabels:
      app: locust-slave
  replicas: 2
  template:
    metadata:
      labels:
        app: locust-slave
    spec:
      containers:
        - name: locust-slave
          image: asatrya/locust
          env:
          - name: LOCUST_MODE
            value: worker
          - name: LOCUST_MASTER_HOST
            value: locust-master
          - name: LOCUST_MASTER_PORT
            value: "5557"
          resources:
            limits:
              memory: "128Mi"
              cpu: "100m"
          ports:
            - containerPort: 5557
              name: comm
            - containerPort: 5558
              name: comm-plus-1
            - containerPort: 8089
              name: web-ui
          volumeMounts:
            - name: locust-task-vol
              mountPath: /locust-tasks/locustfile.py
              subPath: locustfile.py
      volumes:
        - name: locust-task-vol
          configMap:
              name: locust-task-conf
