Skip to content

Commit 60e0394

Browse files
committed
ci to create and delete k8s
1 parent 8770bfd commit 60e0394

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/create-k8s.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,24 @@ nodeGroups:
582582
amiFamily: $AMI_FAMILY
583583
volumeSize: 20
584584
volumeType: gp3
585+
EOF
586+
587+
# Only add SSH configuration if we're not in CI and SSH keys exist
588+
if [[ -z "$GITHUB_ACTIONS" && (-f ~/.ssh/id_rsa.pub || -f ~/.ssh/id_ed25519.pub) ]]; then
589+
cat >> "$CLUSTER_CONFIG" << EOF
585590
ssh:
586591
allow: true
592+
EOF
593+
print_info "SSH access enabled for nodes"
594+
else
595+
cat >> "$CLUSTER_CONFIG" << EOF
596+
ssh:
597+
allow: false
598+
EOF
599+
print_info "SSH access disabled (CI environment or no SSH keys found)"
600+
fi
601+
602+
cat >> "$CLUSTER_CONFIG" << EOF
587603
labels:
588604
role: worker
589605
tags:

0 commit comments

Comments
 (0)