apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: stress
spec:
  serviceName: stress
  selector:
    matchLabels:
      app: stress
  replicas: 0
  podManagementPolicy: Parallel
  template:
    metadata:
      labels:
        app: stress
    spec:
      nodeSelector:
        goal: service
      terminationGracePeriodSeconds: 0
      containers:
        - name: stress
#         image: polinux/stress-ng
#          image: 100.64.176.12:80/stress-ng-apm:latest
          image: stress_ng
          command:
            - sh
            - -c
            - "taskset -c $cpus stress-ng $extra"
          env:
            - name: cpus
              valueFrom: {configMapKeyRef: { name: stress, key: cpus }}
            - name: extra
              valueFrom: {configMapKeyRef: { name: stress, key: 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: []
