-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forbidden sysctl: "vm.max_map_count" not whitelisted #87
Comments
Maybe try this init container as a workaround
|
I had to add an extra line to the securityContext part of your code: Thanks for your help @sdwerwed ! |
Glad you made it work! However, I would leave this issue as open as this workaround is not the solution, it should work with the default values. To maintainers: |
helm-charts/charts/opensearch/values.yaml Line 373 in 8aaa89e
This enabled will result in this being enabled on the sts; {{- if .Values.sysctl.enabled }}
sysctls:
- name: vm.max_map_count
value: {{ .Values.sysctlVmMaxMapCount | quote }}
{{- end }} As explained in those values, your kubelet / node needs to be allowed to access these things (Per the comments): It's not a bug, as the container points out, Kubernetes/CRI can't access the system option because it isn't whitelisted. The recommendation of enabling |
@DandyDeveloper ES Helm chart using |
@dyipon That doesn't make it safe ;) |
Yes I agree it is not safe, but what is safer? The current helm chart will not work unless the user prepare the environment which is not common in Kubernetes, it will be more complicated also in live environments, to modify kublet (not sure if it will need recreation of VM). While with init container will be more compatible and admins will not have to modify kubelet arguments. If it makes way more secure and reliable we can keep it as it is and make a note on readme what is expected from admins to do before installing this chart. |
yes, thats uncommon in kubernetes (for me) if I have to add extra arguments to the kubelet, to whitelist the corresponding sysctl. |
Well, I tried to follow these instructions: Article say 'Only namespaced sysctls can be enabled this way', but vm.max_map_count is not a namespaced sysctl variable, and the preferred kubelet args give this error: Im open for any new suggestion, thanks :) |
Sadly on GKE adding This is the error you'll get if you try to set it using ERROR: (gcloud.beta.container.node-pools.create) ResponseError: code=400, message=Unsupported kernel parameter vm.max_map_count. So it looks like the privileged sysctl init container is the only decent option currently for opensearch... |
I would argue that setting kernel parameters should be left outside. When I researched this I ended up setting it directly on the host, and leaving OpenSearch / helm unprivileged. Not arguing against automating though, we do this with other orchestration tools, but in this ecosystem (k8s) I would say it's best left outside. |
Unfortunately, regarding GKE, there's just not many other options. I don't like the idea of Per the above comment though, there definitely needs to be some understanding that either;
Otherwise, the best bet is |
At least scoping it to an init container is a reasonable compromise for now - as long as we can enable the init container via a flag. |
Close this for now as it seems to be resolved by community. Thanks. |
It would be nice if the init container method in this issue could become an official part of this helm chart and could be toggled with a bool value. |
Hi @acjohnson feel free to contribute the changes if you are available for that :) Thanks. |
I'm indifferent about adding it. If there is an overwhelming (somewhat) need for it. It should be done. Community driver after all |
With k8s v1.25 PodSecurity "baseline:latest" or PodSecurity "restricted:latest", initContainer solution provided above doesn't work as it needs securityContext.privileged: true which is dangerous as well. Also helm-charts/charts/opensearch/values.yaml doesn't work as it does the same thing. error: |
I would like to thank you, this works very well for deprecated kubernetes version 1.15 and official helm chart of opensearch version 2.11.0 |
Hi,
i've tried to install opensearch via helm, but pods are pending with this message:
forbidden sysctl: "vm.max_map_count" not whitelisted
I've tried to override the security settings, but did not help:
helm upgrade --install opensearch opensearch/opensearch --set sysctl.enabled=true --set podSecurityContext.runAsUser=0 --set securityContext.runAsNonRoot=false >test.yml
Im try to migrate from ES, but theirs helm using a bit different method:
they are using a fully privileges initcontainer to set the vm.max_map_count:
What would be the best practice? Others does not have this situation?
thanks
The text was updated successfully, but these errors were encountered: