apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: locust-slave
  name: locust-slave
  namespace: default
spec:
  progressDeadlineSeconds: 600
  # workers 个数
  replicas: 5
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: locust-slave
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: locust-slave
    spec:
      containers:
      - args:
        - --worker
        - --master-host=locust-master
        - --master-port=5557
        image: locustio/locust:1.2.3
        imagePullPolicy: IfNotPresent
        name: locust
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /home/locust
          name: locustfile
        resources:
          limits:
            cpu: "2"
            memory: 1Gi
          requests:
            cpu: 100m
            memory: 128Mi

      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: locustfile
        name: locustfile
