<p>I install elasticsearch from helm stable chart and get stuck at pending bound pvc to pc.</p>

<p>I have create a PC with same label to PVC of helm elastic.<br>
 - How to bound this elastic pvc to pv.  </p>

<p><a href="https://i.stack.imgur.com/bkUdD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bkUdD.png" alt="enter image description here"></a></p>

<p><strong>Update config:</strong><br>
PVC:</p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    app: elasticsearch
    component: data
    release: es
    role: data
  name: data-es-elasticsearch-data-0
  selfLink: /api/v1/namespaces/default/persistentvolumeclaims/data-es-elasticsearch-data-0
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  volumeMode: Filesystem
status: {}
</code></pre>

<p>PV:</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"PersistentVolume","metadata":{"annotations":{},"labels":{"type":"local"},"name":"task-pv-volume"},"spec":{"accessModes":["ReadWriteOnce"],"capacity":{"storage":"15Gi"},"hostPath":{"path":"/app/k8s-volumes"},"storageClassName":"manual"}}
  creationTimestamp: null
  finalizers:
  - kubernetes.io/pv-protection
  labels:
    app: elasticsearch
    component: data
    release: es
    role: data
    type: local
  name: task-pv-volume
  selfLink: /api/v1/persistentvolumes/task-pv-volume
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 15Gi
  hostPath:
    path: /app/k8s-volumes
    type: ""
  persistentVolumeReclaimPolicy: Retain
  storageClassName: manual
  volumeMode: Filesystem
status: {}
</code></pre>

Đinh Anh Huy
<p>The PersistentVolumeClaim and PersistentVolume classes (not labels) must match.The PVC has no <code>storageClassName</code>, so change the PV to have <code>storageClassName: ''</code> and it should work.</p>
