Skip to content

Commit bfcecd9

Browse files
committed
Switch to AL2023_ARM_64_STANDARD
1 parent c90708e commit bfcecd9

File tree

3 files changed

+43
-46
lines changed

3 files changed

+43
-46
lines changed

examples/simple/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ module "materialize_infrastructure" {
5656
node_group_min_size = 1
5757
node_group_max_size = 2
5858
node_group_capacity_type = "ON_DEMAND"
59-
node_group_ami_type = "BOTTLEROCKET_ARM_64"
6059
enable_cluster_creator_admin_permissions = true
6160

6261
# Storage Configuration

modules/eks/bootstrap.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
set -xe
3+
4+
echo "Starting NVMe disk setup"
5+
6+
yum install -y lvm2
7+
8+
ROOT_PART=$(findmnt -n -o SOURCE / | sed 's/\[.*\]//')
9+
ROOT_DEVICE=$(lsblk -no PKNAME "$ROOT_PART")
10+
ROOT_DEVICE="/dev/${ROOT_DEVICE}"
11+
12+
NVME_DEVICES=()
13+
14+
for dev in /dev/nvme*n1; do
15+
if [ "$dev" != "$ROOT_DEVICE" ] && [ -b "$dev" ]; then
16+
NVME_DEVICES+=("$dev")
17+
fi
18+
done
19+
20+
echo "Found NVMe devices: ${NVME_DEVICES[@]:-none}"
21+
22+
if [ ${#NVME_DEVICES[@]} -eq 0 ]; then
23+
echo "No NVMe instance storage devices found"
24+
exit 0
25+
fi
26+
27+
for device in "${NVME_DEVICES[@]}"; do
28+
pvcreate -f "$device"
29+
done
30+
31+
vgcreate instance-store-vg "${NVME_DEVICES[@]}"
32+
33+
pvs
34+
vgs
35+
36+
echo "Disk setup completed"

modules/eks/main.tf

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,7 @@
11
locals {
22
name_prefix = "${var.namespace}-${var.environment}"
33

4-
disk_setup_user_data = base64encode(<<-EOT
5-
#!/bin/bash
6-
set -xeuo pipefail
7-
BOTTLEROCKET_ROOT="/.bottlerocket/rootfs"
8-
DRIVE_PATHS=()
9-
10-
mapfile -t SSD_NVME_DEVICE_LIST < <(lsblk --json --output-all | jq -r '.blockdevices[] | select(.model // empty | contains("Amazon EC2 NVMe Instance Storage")) | .path')
11-
12-
echo "Found NVMe devices: $${SSD_NVME_DEVICE_LIST[@]}"
13-
14-
if [ $${#SSD_NVME_DEVICE_LIST[@]} -eq 0 ]; then
15-
echo "No NVMe instance storage devices found. Exiting."
16-
exit 0
17-
fi
18-
19-
for device in "$${SSD_NVME_DEVICE_LIST[@]}"; do
20-
DRIVE_PATHS+=("$${BOTTLEROCKET_ROOT}$${device}")
21-
done
22-
23-
echo "Configuring drives: $${DRIVE_PATHS[@]}"
24-
25-
for device_path in "$${DRIVE_PATHS[@]}"; do
26-
echo "Creating PV on $${device_path}"
27-
pvcreate "$${device_path}"
28-
done
29-
30-
vgcreate instance-store-vg "$${DRIVE_PATHS[@]}"
31-
EOT
32-
)
4+
disk_setup_script = file("${path.module}/bootstrap.sh")
335
}
346

357
module "eks" {
@@ -66,22 +38,12 @@ module "eks" {
6638
"workload" = "materialize-instance"
6739
}
6840

69-
enable_bootstrap_user_data = true
70-
71-
bootstrap_extra_args = <<-TOML
72-
[settings.bootstrap-containers.default]
73-
mode = "once"
74-
essential = true
75-
user-data = "${local.disk_setup_user_data}"
76-
TOML
77-
78-
# Simpler test to see if the user data is being applied
79-
# bootstrap_extra_args = <<-TOML
80-
# [settings.bootstrap-containers.default]
81-
# mode = "once"
82-
# essential = true
83-
# user-data = "IyEvYmluL2Jhc2gKZWNobyBIRUxMTyBXT1JMRA=="
84-
# TOML
41+
cloudinit_pre_nodeadm = [
42+
{
43+
content_type = "text/x-shellscript"
44+
content = local.disk_setup_script
45+
}
46+
]
8547

8648
}
8749
}

0 commit comments

Comments
 (0)