Files
homelab/talos/talhelper/apply-iscsi-config.sh
Hermes Agent service account f37021346b Enable iSCSI support for Portworx CSI
- Add dm_round_robin kernel module for Pure Storage multipath
- Uncomment and enable /etc/multipath.conf with Pure-specific settings
- Add apply-iscsi-config.sh script for rolling worker node updates
2026-06-20 20:25:08 -05:00

70 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Apply iSCSI configuration to worker nodes
# This regenerates configs with the iscsi-tools extension and applies them
set -e
echo "=========================================="
echo "Talos iSCSI Configuration Update"
echo "=========================================="
echo ""
echo "This will:"
echo " 1. Generate new Talos configs with iscsi-tools extension"
echo " 2. Apply configs to each worker node (one at a time)"
echo " 3. Reboot each node to load iSCSI modules"
echo " 4. Wait for each node to become Ready before continuing"
echo ""
read -p "Proceed? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted."
exit 0
fi
echo ""
echo "Step 1: Generating Talos configurations..."
talhelper genconfig
declare -A WORKERS=(
["jungle-cruise"]="10.1.71.69"
["haunted-mansion"]="10.1.71.70"
["peter-pans-flight"]="10.1.71.71"
)
for worker in jungle-cruise haunted-mansion peter-pans-flight; do
ip="${WORKERS[$worker]}"
echo ""
echo "=========================================="
echo "Updating $worker ($ip)..."
echo "=========================================="
echo "Applying configuration (will reboot)..."
talosctl apply-config --nodes ${ip} \
--file clusterconfig/fastpass-${worker}.yaml \
--mode=reboot
echo "Waiting for $worker to reboot and become Ready..."
sleep 30 # Give it time to start rebooting
kubectl wait --for=condition=Ready node/${worker} --timeout=10m
echo "$worker is back up."
if [ "$worker" != "peter-pans-flight" ]; then
echo "Sleeping 30s before next node..."
sleep 30
fi
done
echo ""
echo "=========================================="
echo "✓ All workers updated!"
echo "=========================================="
echo ""
echo "Verifying iSCSI modules on jungle-cruise..."
kubectl debug node/jungle-cruise -it --image=busybox -- cat /proc/modules | grep -E "iscsi|multipath" || echo "Modules check failed"
echo ""
echo "Next steps:"
echo " 1. Verify iSCSI modules loaded on all nodes"
echo " 2. Proceed with Portworx CSI installation"