Skip to content

Commit b6bf132

Browse files
committed
fix: swap issue
1 parent a1142f4 commit b6bf132

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

infra/terraform/user-data.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ apt-get install -y \
1212
curl wget git unzip jq htop nano ufw \
1313
docker.io
1414

15-
# Docker
16-
systemctl enable --now docker
17-
usermod -aG docker ubuntu # takes effect on next login for 'ubuntu'
18-
19-
# Add swap space (2GB) to help with memory pressure
15+
# Add swap space (2GB) to help with memory pressure - BEFORE K3s starts
2016
fallocate -l 2G /swapfile
2117
chmod 600 /swapfile
2218
mkswap /swapfile
@@ -26,6 +22,10 @@ echo '/swapfile none swap sw 0 0' >> /etc/fstab
2622
# Configure swappiness (how aggressively to use swap - 10 is conservative)
2723
echo 'vm.swappiness=10' >> /etc/sysctl.conf
2824

25+
# Docker
26+
systemctl enable --now docker
27+
usermod -aG docker ubuntu # takes effect on next login for 'ubuntu'
28+
2929
# K3s (pin to stable; adjust as you like)
3030
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=stable sh -s - --write-kubeconfig-mode 640
3131

0 commit comments

Comments
 (0)