Does OpenShift 4 support swap memory on worker nodes?
Environment
- Red Hat Openshift Container Platform (RHOCP)
- 4
- Nodes
- Swap
Issue
- How to enable swap memory of the nodes present in RHOCP4?
- Is it supported to enable swap memory for dev/test environments to reduce memory usage?
Resolution
Currently OpenShift 4 does not support enabling swap on OpenShift nodes; however, there is a This content is not included.RFE to have this feature supported.
Workaround to enable swap memory on OpenShift 4 nodes
There is currently a [Technology Preview features](https://access.redhat.com/support/offerings/techpreview/) to [allow swap memory use on nodes](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/nodes/working-with-nodes#nodes-nodes-swap-memory_nodes-nodes-managing), but note that enabling the `TechPreviewNoUpgrade` feature set **cannot be undone** and **prevents minor version updates**. These feature sets are not recommended on production clusters, and it will be required to reinstall the cluster for being able to update to newer versions
Note: swap memory support is available only for container-native virtualization (CNV) users or use cases. Also, using swap memory can negatively impact workload performance and out-of-resource handling. Do not enable swap memory on control plane nodes.
Root Cause
Disclaimer: Links contained herein to external website(s) are provided for convenience only. Red Hat has not reviewed the links and is not responsible for the content or its availability. The inclusion of any link to an external website does not imply endorsement by Red Hat of the website or their entities, products or services. You agree that Red Hat is not responsible or liable for any loss or expenses that may result due to your use of (or reliance on) the external site or content.
The kubernetes 1.22 release introduced Content from kubernetes.io is not included.alpha support for configuring swap memory usage for Kubernetes workloads running on Linux on a per-node basis. Now, Content from kubernetes.io is not included.in release 1.28, support for swap on Linux nodes has graduated to Beta, along with many new improvements.
Currently, OpenShift 4 does not support swap memory usage on nodes.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.