Skip to content

Commit 6344b0f

Browse files
authored
extra setup rocky10 (#213)
1 parent 245de20 commit 6344b0f

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

aws/rocky10-extra-setup.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
set -exo pipefail
4+
5+
6+
storage_private_ips=$(terraform output -raw storage_private_ips)
7+
BASTION_IP=$(terraform output -raw bastion_public_ip)
8+
KEY="${KEY:-$HOME/.ssh/id_ed25519}"
9+
10+
for node in $storage_private_ips; do
11+
ssh -i "$KEY" -o StrictHostKeyChecking=no \
12+
-o ProxyCommand="ssh -o StrictHostKeyChecking=no -i \"$KEY\" -W %h:%p ec2-user@$BASTION_IP" rocky@$node "sudo reboot"
13+
done
14+
15+
for node in $storage_private_ips; do
16+
echo "Waiting for $node to come back online..."
17+
while ! ssh -i "$KEY" -o StrictHostKeyChecking=no \
18+
-o ProxyCommand="ssh -o StrictHostKeyChecking=no -i \"$KEY\" -W %h:%p ec2-user@$BASTION_IP" rocky@$node "true"; do
19+
sleep 5
20+
done
21+
done
22+
23+
for node in $storage_private_ips; do
24+
ssh -i "$KEY" -o StrictHostKeyChecking=no \
25+
-o ProxyCommand="ssh -o StrictHostKeyChecking=no -i \"$KEY\" -W %h:%p ec2-user@$BASTION_IP" rocky@$node "
26+
total_memory_kb=\$(grep MemTotal /proc/meminfo | awk '{print \$2}')
27+
total_memory_mb=\$((total_memory_kb / 1024))
28+
hugepages=\$((total_memory_mb / 4 / 2))
29+
sudo sysctl -w vm.nr_hugepages=\$hugepages
30+
sudo systemctl restart k3s-agent
31+
"
32+
done

aws/storagenodes-k8s.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ echo "cluster ID: $CLUSTER_ID"
2828
echo "cluster secret: $CLUSTER_SECRET"
2929

3030
NETWORK_INTERFACE="ens5"
31-
if [ "$storage_node_distro" = "rhel9" -o "$storage_node_distro" = "rhel10" ]; then
31+
if [ "$storage_node_distro" = "rhel9" -o "$storage_node_distro" = "rocky10" ]; then
3232
NETWORK_INTERFACE="eth0"
3333
fi
3434

0 commit comments

Comments
 (0)