This repository was archived by the owner on Aug 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,13 +29,10 @@ function add_os_deps() {
2929
3030# permanently disable swap
3131function disable_swap() {
32- swapcount=$( sudo grep ' ^/dev/\([0-9a-z]*\).*' /proc/swaps | wc -l)
33-
34- if [ " $swapcount " != " 0" ]; then
35- sudo systemctl mask " $( sed -n -e ' s#^/dev/\([0-9a-z]*\).*#dev-\1.swap#p' /proc/swaps) " 2> /dev/null
36- else
37- echo " Swap not enabled"
38- fi
32+ # disable current swap
33+ sudo swapoff -a
34+ # permanently disable swap
35+ sudo systemctl mask swap.target
3936}
4037
4138# enable ip forwarding
@@ -137,7 +134,6 @@ function enable_kubelet_runner() {
137134
138135# ensure that the system is ready without requiring a reboot
139136function ensure_system_ready() {
140- sudo swapoff -a
141137 sudo systemctl restart systemd-modules-load.service
142138}
143139
192188
193189echo " Init..."
194190init
191+ echo " Disabling swap..."
192+ disable_swap
195193echo " Setting OS Version..."
196194upate_os_version
197195echo " Adding OS Dependencies..."
198196add_os_deps
199- echo " Disabling swap..."
200- disable_swap
201197echo " Enabling IP Forwarding..."
202198enable_ip_forwarding
203199echo " Setting up modules to load..."
You can’t perform that action at this time.
0 commit comments