NixOS / nixops

NixOps is a tool for deploying to NixOS machines in a network or cloud.
https://nixos.org/nixops
GNU Lesser General Public License v3.0
1.84k stars 363 forks source link

How to Disable Swap? #1062

Open gallexme opened 5 years ago

gallexme commented 5 years ago

Hey to run Kubernetes i need to disable Swap:

ive tried setting in my nixops config:


    swapDevices = []; 

but the swap is still active: free -mh total used free shared buff/cache available Mem: 62Gi 36Gi 790Mi 4.0Mi 25Gi 25Gi Swap: 999Mi 0B 999Mi

and in the fstab is still written

# Swap devices.
/dev/disk/by-label/swap1 none swap
/dev/disk/by-label/swap2 none swap
danbst commented 5 years ago
{ config, lib, ... }: {
  swapDevices = lib.mkForce [ ];
}
onixie commented 4 years ago

I suggest we force swapDevices to be empty in services.kubernetes module or we add an option to let user choose either disable swap or add --fail-swap-on=false .