Skip to content

Commit

Permalink
Merge pull request #18 from latchbio/maximsmol/swap
Browse files Browse the repository at this point in the history
upgrade ubuntu + enable swap
  • Loading branch information
maximsmol authored Aug 30, 2024
2 parents 7986303 + 69cb9f6 commit 619b6bd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions sysbox-eks.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ build {
"source.amazon-ebs.ubuntu-eks",
]

provisioner "shell" {
inline_shebang = "/usr/bin/env bash"
inline = [
"set -o pipefail -o errexit",

"echo '>>> Use cgroup2'",
"sudo sed --in-place 's/GRUB_CMDLINE_LINUX_DEFAULT=\"console=tty1 console=ttyS0 nvme_core.io_timeout=4294967295\"/GRUB_CMDLINE_LINUX_DEFAULT=\"console=tty1 console=ttyS0 nvme_core.io_timeout=4294967295 systemd.unified_cgroup_hierarchy=1\"/g' /etc/default/grub.d/50-cloudimg-settings.cfg",
"sudo update-grub",
"sudo systemctl reboot"
]

expect_disconnect = true
skip_clean = true
pause_after = "10s"
}

provisioner "shell" {
inline_shebang = "/usr/bin/env bash"
inline = [
Expand Down Expand Up @@ -299,6 +315,7 @@ build {
}

provisioner "file" {
# reference: https://github.com/awslabs/amazon-eks-ami/blob/main/templates/al2/runtime/bootstrap.sh
source = "bootstrap.sh.patch"
destination = "/home/ubuntu/bootstrap.sh.patch"
}
Expand Down Expand Up @@ -434,4 +451,15 @@ build {
]
}

provisioner "shell" {
inline_shebang = "/usr/bin/env bash"
inline = [
"set -o pipefail -o errexit",

"echo '>>> Patching kubelet config'",
"sudo dasel put bool --parser json --file /etc/kubernetes/kubelet/kubelet-config.json --selector 'failSwapOn' false",
"sudo dasel put bool --parser json --file /etc/kubernetes/kubelet/kubelet-config.json --selector 'featureGates.NodeSwap' true",
"sudo dasel put string --parser json --file /etc/kubernetes/kubelet/kubelet-config.json --selector 'memorySwap.swapBehavior' 'UnlimitedSwap'",
]
}
}

0 comments on commit 619b6bd

Please sign in to comment.