Skip to content

Document how to set vm.max_map_count on OpenShift with the Node Tuning Operator - #9625

Merged
pebrc merged 5 commits into
elastic:mainfrom
pebrc:eck/openshift-vm-max-map-count-5862
Nov 26, 2026
Merged

pebrc merged 5 commits into
elastic:mainfrom
pebrc:eck/openshift-vm-max-map-count-5862

Conversation

@pebrc

@pebrc pebrc commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

The documentation doesn't explain how to set vm.max_map_count on OpenShift. This adds the explanation and the OpenShift-specific method (the Node Tuning Operator), and links it from the OpenShift pages.

  • virtual-memory.md: new section "Using the Node Tuning Operator on OpenShift" with a Tuned resource example, and how to label the Elasticsearch Pods so that only the nodes that run them are tuned.
  • deploy-eck-on-openshift.md: states the OpenShift default and links the new section.
  • k8s-openshift-deploy-elasticsearch.md: explains the node.store.allow_mmap: false setting in the example with a callout, and links the new section.

Tested on OpenShift 5.0.2 (RHCOS 10.2) with ECK 3.5.0 and Elasticsearch 9.2.0:

  • OpenShift nodes default to vm.max_map_count = 262144, and Elasticsearch starts green with mmap enabled and no tuning. The bootstrap check only requires 262144 (the recommended value is 1048576).
  • A Tuned profile with a plain vm.max_map_count=1048576 is applied by the operator, but the node keeps 262144 and the profile is reported as degraded, because the host sysctl file is applied again after the profile. The same happens with the => form. With operand.tunedConfig.reapply_sysctl: false the node reads 1048576, the profile is healthy, and the Elasticsearch Pod sees 1048576. Nodes without labelled Pods keep the default. The upstream example in the Node Tuning Operator repository does not set reapply_sysctl, and uses 262144.

Not tested: OpenShift 4.x. The default value comes from a machine-config template in openshift/machine-config-operator. The rendering of the new callout and the Tuned example callouts was checked with a local docs-builder build of the changed pages.

Fixes elastic/cloud-on-k8s#5862

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes
  • No

Tool(s) and model(s) used: Claude Code (Claude Sonnet 5.5)

🤖 Generated with Claude Code

pebrc and others added 2 commits November 25, 2026 17:20
…g Operator

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…example

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pebrc
pebrc requested a review from a team as a code owner November 26, 2026 07:34
@github-actions

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.


OpenShift sets `vm.max_map_count` to `262144` on its nodes by default. This is enough for {{es}} to start, because the [bootstrap check](/deploy-manage/deploy/self-managed/bootstrap-checks.md) requires at least `262144`. To set the recommended value `1048576`, use the OpenShift [Node Tuning Operator](https://github.com/openshift/cluster-node-tuning-operator). Pods created by ECK usually run with the `restricted-v2` security context constraint, which doesn't allow a Pod to change kernel settings, so an init container or a DaemonSet doesn't work.

Create a `Tuned` resource that applies the setting to the nodes that run {{es}} Pods:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a numbered step? Like is this step 1 and adding the label to the Elasticsearch Pods through the podTemplate is step 2? Otherwise the steps read as unrelated instead of sequential

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks. The setup is now two numbered steps: create the Tuned resource, then add the label to the Elasticsearch Pods. The two callouts for the Tuned example stay in step 1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pebrc

pebrc commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Content change after the approval: I checked the claim that OpenShift sets vm.max_map_count to 262144 by default. The node template that sets it (templates/common/_base/files/sysctl-vm-max-map.conf.yaml in openshift/machine-config-operator) exists on the release-4.13 and later branches, but not on release-4.10, 4.11 or 4.12. The three sentences now say "OpenShift 4.13 and later", and point earlier versions to the Node Tuning Operator.

…ault"

All OpenShift versions that ECK supports (4.16 and later) set the value by default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pebrc

pebrc commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for the back and forth. I reverted the version qualifier: ECK supports OpenShift 4.16 and later, which all set vm.max_map_count to 262144 by default.

@pebrc
pebrc added this pull request to the merge queue Nov 26, 2026
Merged via the queue into elastic:main with commit c5e233b Nov 26, 2026
14 checks passed
@pebrc
pebrc deleted the eck/openshift-vm-max-map-count-5862 branch November 26, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provide references to Openshift method for adjusting vm.max_map_count setting

2 participants