0

我按照此处的说明在 KIND(Docker 中的 Kubernetes)上安装弹性搜索集群。https://www.elastic.co/blog/alpha-helm-charts-for-elasticsearch-kibana-and-cncf-membership

这是在 Windows 10 上的 Docker 上的 4 节点集群中运行的。我遇到了类似于此处报告的问题:https ://github.com/elastic/helm-charts/issues/137

我试图找出安装位置,以便我可以 CHOWN 那个目录。这在本地机器上映射到哪里?

我还没有运行 WSL2

4

1 回答 1

0

为了更改/usr/share/elasticsearch/data/nodes目录的所有者,您必须创建一个initContainer将更改权限的目录。

您可以通过获取 elasticsearch 图表来做到这一点:

helm fetch --untar elasticsearch elastic/elasticsearch

然后更改values.yaml并添加以下行:

antiAffinity: "soft"

# Shrink default JVM heap.
esJavaOpts: "-Xmx128m -Xms128m"

# Allocate smaller chunks of memory per pod.
resources:
  requests:
    cpu: "100m"
    memory: "512M"
  limits:
    cpu: "1000m"
    memory: "512M"

# Request smaller persistent volumes.
volumeClaimTemplate:
  accessModes: [ "ReadWriteOnce" ]
  storageClassName: "hostpath"
  resources:
    requests:
      storage: 100M
extraInitContainers: |
  - name: create
    image: busybox:1.28
    command: ['mkdir', '/usr/share/elasticsearch/data/nodes/']  
    volumeMounts:
    - mountPath: /usr/share/elasticsearch/data
      name: elasticsearch-master
  - name: file-permissions
    image: busybox:1.28
    command: ['chown', '-R', '1000:1000', '/usr/share/elasticsearch/']
    volumeMounts:
    - mountPath: /usr/share/elasticsearch/data
      name: elasticsearch-master

它更改 pod 的 cpu 和内存请求以及限制,并从更改目录权限initContainerchown', '-R', '1000:1000', '/usr/share/elasticsearch/'命令开始。

于 2020-06-25T15:11:06.673 回答