talos icon indicating copy to clipboard operation
talos copied to clipboard

Swap disk/file

Open sergelogvinov opened this issue 4 years ago • 9 comments

Feature Request

Make possible to add swap disk/file to the system at boot time.

Description

When memory is not enough or memory pressure, system processes need a few extra memory to finish some jobs/gracefully stop pods etc. A small swap disk can help with that.

Proposal:

# example
machine:
  swap:
     disk: /dev/sda
     # or
     size: 1Gb

The swap can be disk/partition (azure has special disk for swap) or file in ephemeral storage. Swap has to be alway encrypted. The encryption key is auto generated at boot time. Sysctl param sets to vm.swappiness=1

If disk param is not set - Talos creates a swap-file with defined size.

disk and size cannot be set in the same time(?)

sergelogvinov avatar Oct 25 '21 18:10 sergelogvinov