[英]pod has unbound immediate PersistentVolumeClaims ECK (Elasticsearch on Kubernetes)
I am trying to deploy elastic on kuberneteshttps://www.elastic.co/guide/en/cloud-on-k8s/current/index.html on a local minikube cluster.我正在尝试在 kuberneteshttps://www.elastic.co/guide/en/cloud-on-k8s/current/index.html上的本地 minikube 集群上部署弹性。 I have already installed the operator.
我已经安装了操作符。
When i apply the elasticsearch cluster below, i get the following pod error:当我在下面应用 elasticsearch 集群时,我收到以下 pod 错误:
running "VolumeBinding" filter plugin for pod "data-es-es-default-0": pod has unbound immediate PersistentVolumeClaims
为 pod“data-es-es-default-0”运行“VolumeBinding”过滤器插件:pod 具有未绑定的立即 PersistentVolumeClaims
volume/claim:数量/索赔:
apiVersion: v1
kind: PersistentVolume
metadata:
name: elasticsearch-data
labels:
type: local
spec:
storageClassName: standard
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
-- --
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elasticsearch-data
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
elastic.yml弹性.yml
apiVersion: elasticsearch.k8s.elastic.co/v1beta1
kind: Elasticsearch
metadata:
name: data-es
spec:
version: 7.4.2
nodeSets:
- name: default
count: 2
volumeClaimTemplates:
- metadata:
name: elasticsearch-data
spec:
accessModes:
- ReadWriteOnce
storageClassName: standard
resources:
requests:
storage: 10Gi
config:
node.master: true
node.data: true
node.ingest: true
node.store.allow_mmap: false
xpack.security.authc.realms:
native:
native1:
order: 1
---
apiVersion: kibana.k8s.elastic.co/v1beta1
kind: Kibana
metadata:
name: data-kibana
spec:
version: 7.4.2
count: 1
elasticsearchRef:
name: data-es
kubectl get pvc kubectl 获取 pvc
pod has unbound immediate PersistentVolumeClaims
pod 有未绑定的立即 PersistentVolumeClaims
Above error means there is no persistentVolume
that can be bound to the PersistentVolumeClaim
.上述错误意味着没有可以绑定到
PersistentVolumeClaim
的persistentVolume
。 By default local-storage
does not really create a persistentVolume
dynamically.默认情况下
local-storage
不会真正动态地创建persistentVolume
卷。
To use dynamic provisioning mechanism of local-storage
storage class you need to configure the local-storage
class so that it can provision the persistentVolume
.要使用
local-storage
存储 class 的动态配置机制,您需要配置local-storage
class 以便它可以配置persistentVolume
。 Check this discussion Kubernetes: What is the best practice for create dynamic local volume to auto assign PVs for PVCs?检查此讨论Kubernetes:创建动态本地卷以自动为 PVC 分配 PV 的最佳实践是什么? .
.
Alternatively without using dynamic provisioning mechanism of a storageclass you need to create a persistentVolume
using hostPath
which can be bound to the PersistentVolumeClaim
.But this is not a recommended solution for production usage.或者,在不使用存储类的动态配置机制的情况下,您需要使用可以绑定到
PersistentVolumeClaim
的hostPath
创建persistentVolume
卷。但这不是生产使用的推荐解决方案。 Check this guide here . 在此处查看本指南。
PersistentVolumeClaim
will be automatically created based on volumeClaimTemplates
in the elastic yaml. PersistentVolumeClaim
将根据弹性volumeClaimTemplates
中的 volumeClaimTemplates 自动创建。 Hence you should not create a PersistentVolumeClaim
.因此,您不应该创建
PersistentVolumeClaim
。
Since nodeSets
count is 2 two PersistentVolumeClaim
is created.由于
nodeSets
计数为 2,因此创建了两个PersistentVolumeClaim
。 So you need to create two persistentVolume
.所以你需要创建两个
persistentVolume
。
apiVersion: v1
kind: PersistentVolume
metadata:
name: elasticsearch-data1
labels:
type: local
spec:
storageClassName: standard
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: elasticsearch-data2
labels:
type: local
spec:
storageClassName: standard
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.