简体   繁体   English

pod 有未绑定的即时 PersistentVolumeClaims ECK(Kubernetes 上的 Elasticsearch)

[英]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

名称 状态 容量 访问模式 存储类别 年龄 elasticsearch-data 绑定 elasticsearch-data 10Gi RWO 标准 8m45s elasticsearch-data-data-es-es-default-0 待定标准 7m40s elasticsearch-data-data-es-es-default-1 待定标准7分39秒

pod has unbound immediate PersistentVolumeClaims pod 有未绑定的立即 PersistentVolumeClaims

Above error means there is no persistentVolume that can be bound to the PersistentVolumeClaim .上述错误意味着没有可以绑定到PersistentVolumeClaimpersistentVolume 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.或者,在不使用存储类的动态配置机制的情况下,您需要使用可以绑定到PersistentVolumeClaimhostPath创建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.

相关问题 Kubernetes、Elasticsearch:0/3 个节点可用:3 个 pod 具有未绑定的即时 PersistentVolumeClaims - Kubernetes, Elasticsearch: 0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims ELK Stateful - 错误:0/1 个节点可用:1 个 pod 具有未绑定的即时 PersistentVolumeClaims - ELK Stateful - ERROR: 0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims Elasticsearch on Kubernetes - “Elastic Cloud (ECK)”与“Helm charts” - Elasticsearch on Kubernetes - 'Elastic Cloud (ECK)' vs 'Helm charts' 使用 Elastic Cloud 中的 Filebeat 模块自动设置 Kibana 和 Elasticsearch,用于 Kubernetes (ECK) - Automated Setup of Kibana and Elasticsearch with Filebeat Module in Elastic Cloud for Kubernetes (ECK) Kube.netes Elasticsearch 8.5.3 Statefulset(非ECK)设置用户名/密码 - Kubernetes Elasticsearch 8.5.3 Statefulset (not ECK) set up username / password ElasticSearch 在 Kube.netes OKD 4.11 中使用 ECK 部署时出现 CrashLoopBackoff - ElasticSearch CrashLoopBackoff when deploying with ECK in Kubernetes OKD 4.11 Elasticsearch 8.5.3 ECK 服务 - Elasticsearch 8.5.3 ECK Services 将 ElasticSearch 迁移到 Kubernetes 上的弹性集群,是否有可能将一些传入流量发送到 ECK 集群? - Migrating ElasticSearch to Elastic cluster on Kubernetes, is there is possible way to send some of the incoming traffic to ECK cluster? Kubernetes Elasticsearch centos - 无法在 pod 中启动 nginx - Kubernetes Elasticsearch centos - unable to start nginx in the pod 在Kubernetes集群中运行的Elasticsearch Pod的基本身份验证 - Basic authentication for elasticsearch pod running in kubernetes cluster
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM