Setting vm.max_map_count for mongodb with helm chart

huangapple go评论65阅读模式
英文:

Setting vm.max_map_count for mongodb with helm chart

问题

我成功地使用Bitnami的Helm Charts启动了MongoDB,并将其创建为一个副本集。但是它报错说vm.max_map_count太低。通常情况下,这个问题可以通过initContainer来解决。但是我不知道如何在Helm Chart中使用initContainer。

用于启动副本集的命令如下:

helm install mongodb-service oci://registry-1.docker.io/bitnamicharts/mongodb -f values.yaml --set architecture="replicaset"

以下是Chart中的values部分:

initContainers: []

@param sidecars Add additional sidecar containers for the MongoDB(®) pod(s)

Example:

sidecars:

- name: your-image-name

image: your-image

imagePullPolicy: Always

ports:

- name: portname

containerPort: 1234

以下是在非MongoDB容器上设置该参数的示例:

containers:
- name: sysctl
image: busybox
command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']

英文:

I am successfully starting the mongodb with helm charts from bitnami. Also creating it as a replicaset. But it complains that the vm.max_map_count is too low. It seems like this is usually handled by an initContainer call. But I can't figure out how to do that with a helm chart.

Command used to start the replicaset

helm install mongodb-service oci://registry-1.docker.io/bitnamicharts/mongodb -f values.yaml --set architecture="replicaset"

This is the values part of the chart

initContainers: []
## @param sidecars Add additional sidecar containers for the MongoDB(®) pod(s)
## Example:
## sidecars:
##   - name: your-image-name
##     image: your-image
##     imagePullPolicy: Always
##     ports:
##       - name: portname
##         containerPort: 1234

Example of setting the parameter on a non mongodb container.

containers:
      - name: sysctl
        image: busybox
        command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']

答案1

得分: 0

根据bitnami helm chart的描述,你只需要将以下部分替换掉:

initContainers: []

替换为:

initContainers:
   - name: sysctl
     image: busybox
     command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']

在values.yaml文件中,被以下命令引用:

helm install mongodb-service oci://registry-1.docker.io/bitnamicharts/mongodb -f values.yaml --set architecture="replicaset"
英文:

According to bitnami helm chart description you just need to replace

initContainers: []

with

initContainers:
   - name: sysctl
     image: busybox
     command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']

in values.yaml reffered by

helm install mongodb-service oci://registry-1.docker.io/bitnamicharts/mongodb -f values.yaml --set architecture="replicaset

huangapple
  • 本文由 发表于 2023年7月27日 14:39:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76777085.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定