apiVersion: apps/v1
kind: Deployment
metadata:
  name: reproducer-cephfs
  labels:
    app: reproducer-cephfs
spec:
  replicas: 6
  selector:
    matchLabels:
      app: reproducer-cephfs
  template:
    metadata:
      labels:
        app: reproducer-cephfs
    spec:
      topologySpreadConstraints:
        - labelSelector:
            matchLabels:
              app: reproducer-cephfs
          maxSkew: 1
          topologyKey: topology.kubernetes.io/zone
          whenUnsatisfiable: DoNotSchedule
        - labelSelector:
             matchLabels:
               app: reproducer-cephfs
          maxSkew: 1
          topologyKey: kubernetes.io/hostname
          whenUnsatisfiable: ScheduleAnyway
      nodeSelector:
        node-role.kubernetes.io/worker: ""
      containers:
      - name: log-writer-reader
        image: quay.io/mbukatov/logwriter:ocs-ci
        command:
        - /bin/bash
        - "-c"
        - "/opt/logwriter.py --fsync -d -p  10 . & /opt/logreader.py -r 1000000 *.log"
        workingDir: /mnt/target
        volumeMounts:
        - mountPath: /mnt/target
          name: logwriter-cephfs-volume
      volumes:
      - name: logwriter-cephfs-volume
        persistentVolumeClaim:
          claimName: logwriter-cephfs-many
