apiVersion: apps/v1
kind: Deployment
metadata:
  name: locust-master
spec:
  selector:
    matchLabels:
      app: locust-master
  replicas: 1
  template:
    metadata:
      labels:
        app: locust-master
    spec:
      containers:
        - name: locust-master
          image: asatrya/locust
          env:
          - name: TARGET_HOST
            valueFrom:
              configMapKeyRef:
                name: locust-config
                key: TARGET_HOST
          - name: LOCUST_MODE
            value: master
          - name: LOCUST_OPTS
            value: --print-stats
          resources:
            limits:
              memory: "128Mi"
              cpu: "100m"
          ports:
            - containerPort: 5557
              name: comm
            - containerPort: 5558
              name: comm-plus-1
            - containerPort: 8089
              name: web-ui