英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论