From Fedora Project Wiki

Enable systemd-oomd and zram swap for CoreOS

This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.

Summary

Enable systemd-oomd.service and swap on zram by default to align Fedora CoreOS with other Fedora variants.

Owners

  • Name: Nemric
  • Email: emeric at i-chassagne dot fr
  • Name: jbtrystram
  • Email: jbtrystram@redhat.com


Current status

Detailed Description

Enable systemd-oomd.service and swap on zram in CoreOS by default as it's done in other Fedora variants. This was historically disabled because Kubernetes was not compatible with swap on nodes until recently (provision-swap-memory). As CoreOS targets container workloads it made sense to aim for a better kubernetes experience.

Note that this will not only affect new installs, but also existing running nodes. See more discussion in https://github.com/coreos/fedora-coreos-tracker/issues/840 and https://github.com/coreos/fedora-coreos-tracker/issues/859

Feedback

The change author (Nemric) have been using swap on zram since years now, and kubernetes is working great with that. He also enabled systemd-oomd.service months ago without issues with the following kubelet config:

apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
failSwapOn: false
memorySwap:
  swapBehavior: LimitedSwap

Benefit to Fedora

That will reduce the CoreOS configuration as we would simply inherit what's default in Fedora. This is a reduction in maintenance work.


Scope

  • Proposal owners:
    • Remove the overrides from the config
    • Write a release-notes entry detailing the change.


Upgrade/compatibility impact

This change will affect all nodes then, take care of apps that won't accept swap as default behavior like kubernetes see Feedback

How To Test

see https://fedoraproject.org/wiki/QA:Testcase_CoreOS_swap_on_zram


User Experience

Contingency Plan

Disable the service in the next release and ship a migration script to turn it off for nodes that were deployed with the service active.


Release Notes