Skip to content

Disable swap during system configuration#65

Open
wenxuan0923 wants to merge 4 commits intoAzure:mainfrom
wenxuan0923:wenx/disable-swap
Open

Disable swap during system configuration#65
wenxuan0923 wants to merge 4 commits intoAzure:mainfrom
wenxuan0923:wenx/disable-swap

Conversation

@wenxuan0923
Copy link
Collaborator

kubelet has a hard requirement that swap be completely disabled. vm.swappiness = 0 ensures minimal swap usage but it didn't solve the root problem. We need swapoff -a to removes swap from /proc/swaps so kubelet can start properly.

Sample error msg:

v-1 kubelet[12704]: I0205 10:58:14.917056 12704 manager.go:233] Version: {KernelVersion:6.8.0-94-generic ContainerOsVersion:Ubuntu 22.04.5 LTS DockerVersion: Docke>
Feb 05 10:58:14 bmoore-v-1 kubelet[12704]: I0205 10:58:14.917138 12704 server.go:772] "--cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /"
Feb 05 10:58:14 bmoore-v-1 kubelet[12704]: I0205 10:58:14.917220 12704 swap_util.go:115] "Swap is on" /proc/swaps contents=<
Feb 05 10:58:14 bmoore-v-1 kubelet[12704]: Filename Type Size Used Priority
Feb 05 10:58:14 bmoore-v-1 kubelet[12704]: /swapfile file 3991548 0 -2
Feb 05 10:58:14 bmoore-v-1 kubelet[12704]: >
Feb 05 10:58:14 bmoore-v-1 kubelet[12704]: E0205 10:58:14.917245 12704 run.go:72] "command failed" err="failed to run Kubelet: running with swap on is not supported, please disable swap >
Feb 05 10:58:14 bmoore-v-1 systemd[1]: kubelet.service: Main process exited, code=exited, status=1/FAILURE
Feb 05 10:58:14 bmoore-v-1 systemd[1]: kubelet.service: Failed with result 'exit-code'.
Feb 05 10:58:15 bmoore-v-1 systemd[1]: kubelet.service: Scheduled restart job, restart counter is at 5.
Feb 05 10:58:15 bmoore-v-1 systemd[1]: Stopped Kubelet.
Feb 05 10:58:15 bmoore-v-1 systemd[1]: kubelet.service: Start request repeated too quickly.
Feb 05 10:58:15 bmoore-v-1 systemd[1]: kubelet.service: Failed with result 'exit-code'.
Feb 05 10:58:15 bmoore-v-1 systemd[1]: Failed to start Kubelet.

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.

1 participant