
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: perftest-fio
  labels:
    app: perftest
    component: fio
spec:
  serviceName: perftest-fio
  selector:
    matchLabels:
      app: perftest
      component: fio
  replicas: 1
  template:
    metadata:
      labels:
        app: perftest
        component: fio
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: component
                operator: In
                values:
                - fio
            topologyKey: kubernetes.io/hostname
      securityContext:
        fsGroup: 1000
      containers:
      - name: fio
        image: flokkr/perftest
        args:
        - /opt/tester/test.sh
        volumeMounts:
        - name: script
          mountPath: /opt/tester/test.sh
          subPath: test.sh
        - name: data
          mountPath: /data
      volumes:
      - name: script
        configMap:
          name: fio-testscript
          defaultMode: 493
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes:
      - ReadWriteOnce
      storageClassName: local-path
      resources:
        requests:
          storage: 2Gi
