Skip to content

Commit

Permalink
fix grub config
Browse files Browse the repository at this point in the history
Signed-off-by: maximsmol <1472826+maximsmol@users.noreply.github.com>
  • Loading branch information
maximsmol committed Aug 29, 2024
1 parent 30cf090 commit 054e8d3
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 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 @@ -444,14 +461,4 @@ build {
"sudo dasel put bool --parser json --file /etc/kubernetes/kubelet/kubelet-config.json --selector 'kubeletconfig.featureGates.NodeSwap' true",
]
}

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

"echo '>>> Use cgroup2'",
"sudo grubby --update-kernel=/boot/vmlinuz-$(uname -r) --args='systemd.unified_cgroup_hierarchy=1'",
]
}
}

0 comments on commit 054e8d3

Please sign in to comment.