apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  labels:
    role: locust-slave
  name: locust-slave
spec:
  replicas: 1
  selector:
    matchLabels:
      role: locust-slave
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        role: locust-slave
    spec:
      containers:
      - image: grubykarol/locust:0.8.1-py3.6
        imagePullPolicy: IfNotPresent
        name: locust-slave
        env:
          - name: ATTACKED_HOST
            valueFrom:
              configMapKeyRef:
                name: locust-cm
                key: ATTACKED_HOST
          - name: LOCUST_MODE
            value: SLAVE
          - name: LOCUST_MASTER
            value: locust-master
        volumeMounts:
          - mountPath: /locust
            name: locust-scripts
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - name: locust-scripts
        configMap:
          name: scripts-cm
