This is the Stable version of the documentation. The latest version is experimental and under active development. You can use the version selector in the top-right menu to switch versions for this specific page, or click here to go to the latest version's homepage.
Perform OS-Level Kernel Tuning
Sysctl: vm.max_map_count
Section titled “Sysctl: vm.max_map_count”Some components in the Opstella stack (e.g., SonarQube, Elasticsearch-based services) require a higher limit on the number of memory map areas a process may have.
This is REQUIRED for ALL Worker Nodes in your Kubernetes Cluster.
Failure to set this parameter may cause these services to fail to start or crash unexpectedly.
1. Pre-check current value
Run the following command to check the current value on each worker node:
sudo sysctl vm.max_map_countIf the value is greater than or equal to 262144, you can skip this section.
2. Set value permanently
To set this value permanently, add or update the vm.max_map_count setting in /etc/sysctl.conf.
... (deducted)vm.max_map_count=2621443. Reload sysctl configuration
sudo sysctl --systemsudo systemctl restart systemd-sysctl4. Verify the setting
sudo sysctl vm.max_map_countThe output should return 262144.
Clusters without node access (managed Kubernetes)
Section titled “Clusters without node access (managed Kubernetes)”On a managed Kubernetes service the nodes usually cannot be reached over SSH at all, so none of the
commands above can be run. vm.max_map_count is not namespaced, so any Pod on the node reads the
node’s own value through /proc. Use a DaemonSet that already runs on every node — antrea-agent,
cilium, calico-node, kube-proxy — as the way in:
for p in $(kubectl get pod -n kube-system -l component=antrea-agent -o name); do echo -n "$(kubectl get $p -n kube-system -o jsonpath='{.spec.nodeName}'): " kubectl exec -n kube-system $p -- cat /proc/sys/vm/max_map_countdoneEvery node must report 262144 or higher. Many managed node images already ship a much larger
value (VMware TKG v1.34.2+vmware.2, for example, ships 1048576), in which case there is nothing
to do.
If a node is below the requirement and you cannot log in to it, the value has to be raised where the node is defined, not on the running node:
- the node-pool / node-image template of your provider (
preKubeadmCommands, cloud-init, a baked image), or - a privileged DaemonSet that sets the sysctl on start, or
securityContext.sysctlson the Pod, which needsvm.max_map_countin the kubelet’s--allowed-unsafe-sysctls.
Finished?
Use the below navigation to proceed