Skip to content

Demo swap #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions modules/eks/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ fi

# Create physical volumes
for device in "${SSD_NVME_DEVICE_LIST[@]}"; do
pvcreate -f "$device"
mkswap "$device"
swapon "$device"
done

# Create volume group
vgcreate instance-store-vg "${SSD_NVME_DEVICE_LIST[@]}"
echo "Disk setup completed"

# Display results
pvs
vgs
modprobe zram
zramctl /dev/zram0 --algorithm zstd --size "$(($(grep -Po 'MemTotal:\s*\K\d+' /proc/meminfo)/2))KiB"
mkswap /dev/zram0
swapon --discard --priority 100 /dev/zram0

echo "Disk setup completed"
echo "ram setup completed"
25 changes: 20 additions & 5 deletions modules/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,32 @@ module "eks" {
labels = {
Environment = var.environment
GithubRepo = "materialize"
"materialize.cloud/disk" = var.enable_disk_setup ? "true" : "false"
"materialize.cloud/disk" = "false"
"workload" = "materialize-instance"
}

cloudinit_pre_nodeadm = var.enable_disk_setup ? [
cloudinit_pre_nodeadm = [
{
content_type = "text/x-shellscript"
content = local.disk_setup_script
}
] : []

},
{
content_type = "application/node.eks.aws"
content = <<-EOT
---
apiVersion: node.eks.aws/v1alpha1
kind: NodeConfig
spec:
kubelet:
config:
failSwapOn: false
featureGates:
NodeSwap: true
memorySwap:
swapBehavior: LimitedSwap
EOT
},
]
}
}

Expand Down
Loading