File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,35 @@ deploy_cluster() {
33
33
ansible-playbook -i " $INVENTORY_FILE " kubernetes-single-node.yaml
34
34
35
35
echo " Deployment complete!"
36
- echo " Check the instance details file for SSH access information."
36
+ echo " "
37
+ echo " === Instance Information ==="
38
+
39
+ # Find the most recent instance details file
40
+ DETAILS_FILE=$( ls -rt instance-* -details.txt | tail -1)
41
+
42
+ if [ -n " $DETAILS_FILE " ]; then
43
+ # Extract key information from the details file
44
+ INSTANCE_ID=$( grep " Instance ID:" " $DETAILS_FILE " | cut -d' ' -f3)
45
+ INSTANCE_NAME=$( grep " Instance Name:" " $DETAILS_FILE " | cut -d' ' -f3)
46
+ PUBLIC_IP=$( grep " Public IP:" " $DETAILS_FILE " | cut -d' ' -f3)
47
+ PRIVATE_IP=$( grep " Private IP:" " $DETAILS_FILE " | cut -d' ' -f3)
48
+ INSTANCE_TYPE=$( grep " Instance Type:" " $DETAILS_FILE " | cut -d' ' -f3)
49
+ SSH_COMMAND=$( grep " ssh -i" " $DETAILS_FILE " )
50
+
51
+ echo " Instance ID: $INSTANCE_ID "
52
+ echo " Instance Name: $INSTANCE_NAME "
53
+ echo " Instance Type: $INSTANCE_TYPE "
54
+ echo " Public IP: $PUBLIC_IP "
55
+ echo " Private IP: $PRIVATE_IP "
56
+ echo " "
57
+ echo " SSH Access:"
58
+ echo " $SSH_COMMAND "
59
+ echo " "
60
+ echo " Full details saved to: $DETAILS_FILE "
61
+ else
62
+ echo " Warning: Could not find instance details file"
63
+ echo " Check the instance details file for SSH access information."
64
+ fi
37
65
}
38
66
39
67
cleanup_instances () {
Original file line number Diff line number Diff line change 10
10
key_pair : router-team-us-east2
11
11
security_group_id : sg-0704e6bcaa5e655b1 # k8s security group
12
12
root_volume_size : 500 # GB
13
- instance_name : " GPU-Instance -{{ ansible_date_time.epoch }}"
13
+ instance_name : " {{ ansible_hostname }} -{{ ansible_date_time.epoch }}"
14
14
15
15
tasks :
16
16
- name : Ensure boto3 and botocore are installed
You can’t perform that action at this time.
0 commit comments