I install elasticsearch from helm stable chart and get stuck at pending bound pvc to pc.
I have create a PC with same label to PVC of helm elastic.
- How to bound this elastic pvc to pv.
Update config:
PVC:
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: {}
PV:
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: {}
The PersistentVolumeClaim and PersistentVolume classes (not labels) must match.The PVC has no storageClassName
, so change the PV to have storageClassName: ''
and it should work.
I guess you're using no storage class if you create the PV manually. But you're defining a storage class in the PV. So, try to re-create the PV without the storageClassName
field:
apiVersion: v1
kind: PersistentVolume
metadata:
name: task-pv-volume
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 15Gi
hostPath:
path: /app/k8s-volumes
type: ""
persistentVolumeReclaimPolicy: Retain
volumeMode: Filesystem