Files
herolib/lib/installers/virt/kubernetes_installer/templates/test_simple_lifecycle.heroscript
peternashaat dc2f8c2976 feat: Add K3s installer with complete lifecycle management
Implemented a production-ready K3s Kubernetes installer with full lifecycle
support including installation, startup management, and cleanup.

Key features:
- Install first master (cluster init), join additional masters (HA), and workers
- Systemd service management via StartupManager abstraction
- IPv6 support with Mycelium interface auto-detection
- Robust destroy/cleanup with proper ordering to prevent hanging
- Complete removal of services, processes, network interfaces, and data
2025-11-27 14:01:22 +01:00

45 lines
1.4 KiB
Plaintext

#!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run
import incubaid.herolib.core.playcmds
import incubaid.herolib.ui.console
console.print_header('='*.repeat(80))
console.print_header('K3s Install/Uninstall Lifecycle Test')
console.print_header('='*.repeat(80))
// ============================================================================
// PHASE 1: Install Master
// ============================================================================
console.print_header('\n📦 PHASE 1: Installing K3s Master')
install_script := '
!!kubernetes_installer.configure
name:"k3s_test"
node_name:"test-master"
!!kubernetes_installer.install_master name:"k3s_test"
!!kubernetes_installer.start name:"k3s_test"
'
playcmds.run(heroscript: install_script)!
console.print_header('✅ Installation completed!')
// ============================================================================
// PHASE 2: Uninstall
// ============================================================================
console.print_header('\n🧹 PHASE 2: Uninstalling K3s')
uninstall_script := '
!!kubernetes_installer.configure
name:"k3s_test"
!!kubernetes_installer.destroy name:"k3s_test"
'
playcmds.run(heroscript: uninstall_script)!
console.print_header('✅ Uninstallation completed!')
console.print_header('\n' + '='.repeat(80))
console.print_header('✅ FULL LIFECYCLE TEST COMPLETED!')
console.print_header('='.repeat(80))