Storage in StatefulSet in Kubernetes

If you want separate volumes per each Pod in statefulSet: you need to use volumeClaimTemplate - is really a PVC, but templatized:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mysql
  labels:
    app: mysql
spec:
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
      - name: mysql
        image: mysql
        volumeMounts:
        - mountPath: /var/lib/mysql
          name: data-volume
  replicas:3
  selector:
    matchLabels:
      app: mysql
  serviceName: mysql-h
  volumeClaimTemplates:
  - metadata:
      name: data-volume
    spec:
      accessModes:
        - ReadWriteOnce
      storageClassName: google-storage
      resources:
        requests:
          storage: 300Mi