<p>I tried to use helm on docker for windows on the local machine. When I used a storage class as local storage, persistent volume, and persistent volume claim without helm, it works fine. But when I used this setting with helm, CrashLoopBackOff happened.  </p>

<p>localStrageClass.yaml</p>

<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
</code></pre>

<p>pv.yaml</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: local-pv002
  labels:
    type: local
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteMany
  #storageClassName: hostpath
  mountOptions:
    - hard
  persistentVolumeReclaimPolicy: Delete
  storageClassName: local-storage
  local:
    path: /c/k/share/mysql
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        #- key: docker.io/hostname
        - key: kubernetes.io/hostname
          operator: In
          values:
          - docker-desktop
</code></pre>

<p>pvc.yaml</p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: local-mysql-claim
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Gi
  storageClassName: local-storage
</code></pre>

<p>mysqlConf.yaml</p>

<pre><code>persistence:
  enabled: true
  storageClass: local-storage
  existingClaim: local-mysql-claim
  accessMode: ReadWriteOnce
  size: 1Gi
  annotations: {}
</code></pre>

<p>$ helm install --name mysql stable/mysql -f mysqlConf.yaml<br>
$ kubectl describe pod mysql</p>

<pre><code>Containers:
  mysql:
    Container ID:   docker://533e4569603b05fac83a0a701da97898b3190503618796678ac5db6340c4dce6
    Image:          mysql:5.7.14
    Image ID:       docker-pullable://mysql@sha256:c8f03238ca1783d25af320877f063a36dbfce0daa56a7b4955e6c6e05ab5c70b
    Port:           3306/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Thu, 28 Mar 2019 13:24:25 +0900
      Finished:     Thu, 28 Mar 2019 13:24:25 +0900
    Ready:          False
    Restart Count:  2
    Requests:
      cpu:      100m
      memory:   256Mi
    Liveness:   exec [sh -c mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}] delay=30s timeout=5s period=10s #success=1 #failure=3
    Readiness:  exec [sh -c mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}] delay=5s timeout=1s period=10s #success=1 #failure=3

    Environment:
      MYSQL_ROOT_PASSWORD:  &lt;set to the key 'mysql-root-password' in secret 'mysql'&gt;  Optional: false
      MYSQL_PASSWORD:       &lt;set to the key 'mysql-password' in secret 'mysql'&gt;       Optional: true
      MYSQL_USER:
      MYSQL_DATABASE:
    Mounts:
      /var/lib/mysql from data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-dccpv (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  local-mysql-claim
    ReadOnly:   false
  default-token-dccpv:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-dccpv
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason     Age                From                     Message
  ----     ------     ----               ----                     -------
  Normal   Scheduled  39s                default-scheduler        Successfully assigned default/mysql-698897ff79-n768k to docker-desktop
  Normal   Pulled     38s                kubelet, docker-desktop  Container image "busybox:1.29.3" already present on machine
  Normal   Created    38s                kubelet, docker-desktop  Created container
  Normal   Started    38s                kubelet, docker-desktop  Started container
  Normal   Pulled     18s (x3 over 37s)  kubelet, docker-desktop  Container image "mysql:5.7.14" already present on machine
  Normal   Created    17s (x3 over 37s)  kubelet, docker-desktop  Created container
  Normal   Started    17s (x3 over 37s)  kubelet, docker-desktop  Started container
  Warning  BackOff    13s (x5 over 35s)  kubelet, docker-desktop  Back-off restarting failed container
</code></pre>

<p>When storageClassName was hostpath or did not used the configuration file as<br>
$ helm install --name mysql stable/mysql<br>
it worked fine.  </p>

<p>Please tell me how to fix this problem.</p>

k_trader
<p>I think you are having a mismatch of accessModes between what you claim in PVC definition (ReadWriteOnce) and what your Storage Class offers (ReadWriteMany).</p>

<p>Please mind also that PersistentVolume(s) of HostPath type does not support ReadWriteMany mode (see <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">spec</a> here).</p>

<p>I would propose you to create PV similar to this one:</p>

<pre><code># Create PV of manual StorageClass
kind: PersistentVolume
apiVersion: v1
metadata:
  name: task-pv-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/C/Users/K8S/mysql" 
</code></pre>

<p>and override default PVC storageClassName configuration during helm install like this:</p>

<pre><code>helm install --name my-sql stable/mysql --set persistence.storageClass=manual
</code></pre>
