An interactive PowerShell script for creating and bootstrapping Kubernetes clusters on Talos Linux with Hyper-V.
- Windows 10 or 11 with Hyper-V enabled
- PowerShell 5.1+ run as Administrator
- talosctl installed and on
PATH - kubectl installed and on
PATH
Clone:
git clone https://github.com/firassBenNacib/Talos-HyperV-Bootstrap.git
cd Talos-HyperV-BootstrapBoot in Talos maintenance mode. The script attaches the ISO for new VMs and downloads it if it’s missing. You can override with -TalosISO and -TalosVersion.
See the Talos docs for more information.
1) Create VMs (1 control-plane + 1 worker)
.\Talos.ps1 create -Cluster cluster-lab -SwitchName talos2) Bootstrap
.\Talos.ps1 bootstrap -Cluster cluster-lab3) Fetch and activate kubeconfig
.\Talos.ps1 kubeconfig -Cluster cluster-labMerge kubeconfigs
.\Talos.ps1 merge -Cluster cluster-lab-1,cluster-lab-2 -Name homelabActivate the merged set:
.\Talos.ps1 kubeconfig -Cluster homelabVM management
.\Talos.ps1 list -ShowDisk.\Talos.ps1 start -All.\Talos.ps1 stop -Cluster cluster-labDisk operations
.\Talos.ps1 disk -Cluster cluster-lab -ControlPlanesOnly -ResizeDisk 40G.\Talos.ps1 disk -Cluster cluster-lab -WorkersOnly -AddDisk 100GCleanup
.\Talos.ps1 clean -Cluster cluster-lab -Purge.\Talos.ps1 unmerge -AllUsage: .\Talos.ps1 <Command> [options]
Commands
create Create VMs
bootstrap Configure nodes and bootstrap Kubernetes
kubeconfig Fetch/activate kubeconfig for a cluster or merged set
merge Merge kubeconfigs
unmerge Remove a merged kubeconfig set
clean Remove VMs and artifacts
start Start VMs
stop Stop VMs
list List clusters and VM states
disk Resize OS VHD or attach data disks
help Show help
Global
-Cluster <name>|-All|-Force-SwitchName <vSwitch>-Dest <path>-TalosISO <path>|-TalosVersion <v>-InstallDisk </dev/sda|...>-DefaultPrefix <n>-NoConsole-ShowDisk
create
-ControlPlaneCount <n>|-WorkerCount <n>-ServerCPUs <n>|-WorkerCPUs <n>-ServerMem <size>|-WorkerMem <size>-ServerDisk <size>|-WorkerDisk <size>-VLAN <id>|-Bootstrap
bootstrap
-Gateway <IPv4>|-DNS <IPv4>-NtpSettleSeconds <n>-KeepIso
merge / unmerge
-Name <name>|-All
disk
-ResizeDisk <size>|-AddDisk <size>-ControlPlanesOnly|-WorkersOnly|-Node <vm[,vm...]>
This project is licensed under the GPL-3.0.
Created and maintained by Firas Ben Nacib - bennacibfiras@gmail.com
