apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: sysbench-memory
spec:
  replicas: 0
  serviceName: sysbench-memory
  podManagementPolicy: Parallel
  selector:
    matchLabels:
      app: sysbench-memory
  template:
    metadata:
      labels:
        app: sysbench-memory
    spec:
      terminationGracePeriodSeconds: 0
      containers:
        - name: sysbench
          image: sysbench
          imagePullPolicy: Always
          envFrom:
            - configMapRef:
                name: sysbench-memory
          command:
            - sh
            - -c
            - >
              sysbench
              --threads=$threads
              memory
              run
              --time=0
              --memory-block-size=$memory
              --memory-total-size=0
              --report-interval=$report_interval
              $extra

  # required for workaround bug with kustomize https://github.com/kubernetes-sigs/kustomize/issues/504
  # when using commonLabels
  # fixed in 2.1.0 https://github.com/kubernetes-sigs/kustomize/commit/c470982ce5b96da82a757f088a842bb05d3bcdb4
  volumeClaimTemplates: []
