apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: test-stateful
spec:
  selector:
    matchLabels:
      app: test-stateful
  serviceName: test-stateful
  replicas: 2
  template:
    metadata:
      labels:
        app: test-stateful
    spec:
      terminationGracePeriodSeconds: 10
      schedulerName: stork
      containers:
      - name: test-stateful
        image: alpine:3.8
        command: ["/bin/sh"]
        args: ["-c", "mkdir -p /usr/share/test; while true; do date >> /usr/share/test/date.log; sleep 10; done"]
        volumeMounts:
        - name: datelog
          mountPath: /usr/share/test
    # volumes: 
    # - name: log
    #   persistentVolumeClaimName:
    #     claimName: pwx-test-pvc
  volumeClaimTemplates:
   - metadata:
       name: datelog
     spec:
       accessModes: [ "ReadWriteOnce" ]
       storageClassName: pwx-custom-random-secure-sc
       resources:
         requests:
           storage: 1Gi