-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdirect-talos-maintenance.sh
More file actions
executable file
·62 lines (50 loc) · 2 KB
/
direct-talos-maintenance.sh
File metadata and controls
executable file
·62 lines (50 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# direct-talos-maintenance.sh - Deploy official Talos AMI in maintenance mode
set -e
echo "🎯 Launching official Talos ARM64 AMI in maintenance mode..."
# Find latest official Talos ARM64 AMI (use v1.11.1)
echo "🔍 Using official Talos v1.11.1 ARM64 AMI..."
TALOS_AMI="ami-0d0b5ac770722d15e"
echo "📀 Using official Talos ARM64 AMI: $TALOS_AMI"
# Fixed IP for consistency
IPV4_ADDRESS="10.10.1.106"
# Create minimal cloud-init for maintenance mode (no config = maintenance mode)
cat > cloud-init.yaml << EOF
#cloud-config
# No Talos config = maintenance mode by default
runcmd:
- echo "Talos should boot into maintenance mode"
EOF
echo "📝 Created minimal cloud-init for maintenance mode"
# Launch instance with official Talos AMI
echo "🚀 Launching Talos instance..."
INSTANCE_ID=$(aws ec2 run-instances \
--region eu-west-1 \
--image-id $TALOS_AMI \
--count 1 \
--instance-type t4g.small \
--security-group-ids sg-0e6b4a78092854897 \
--subnet-id subnet-07a140ab2b20bf89b \
--private-ip-address $IPV4_ADDRESS \
--ipv6-address-count 1 \
--no-associate-public-ip-address \
--user-data file://cloud-init.yaml \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=talos-maintenance-mode}]' \
--query 'Instances[0].InstanceId' \
--output text)
echo "✅ Created instance: $INSTANCE_ID at $IPV4_ADDRESS"
# Wait for instance to be running
echo "⏳ Waiting for instance to be running..."
aws ec2 wait instance-running --region eu-west-1 --instance-ids $INSTANCE_ID
echo "🎯 Talos should be booting into maintenance mode..."
echo "⌛ Wait ~3-5 minutes for Talos API to be available"
echo ""
echo "🔍 Test connectivity:"
echo " talosctl -n $IPV4_ADDRESS -e $IPV4_ADDRESS health --server=false"
echo ""
echo "🌐 Then run Talm discovery:"
echo " talm -n $IPV4_ADDRESS -e $IPV4_ADDRESS template -t templates/controlplane.yaml -i > nodes/node1.yaml"
echo ""
echo "💻 Instance: $INSTANCE_ID"
echo "📍 IP: $IPV4_ADDRESS"
rm -f cloud-init.yaml