PowerShell script to deploy Kubernetes cluster on Microsoft Hyper-V Server
You have to Start Powershell as administartor and run command set-executionpolicy remotesigned
. It make all scripts and configuration files downloaded from the Internet are signed by a trusted publisher.
Install-Tools
: Install packages kubectl, docker, qemu-imgShow-Config
: show script config varsDeploy-Network
: install private or public host networkDeploy-HostsFile
: append private network node names to etc/hostsGet-Image
: download the VM imageDeploy-Master
: create and launch master nodeDeploy-NodeN
: create and launch worker node (node1, node2, ...)Save-ISOMaster
: save master nodeSave-ISONodeN
: save worker node (node1, node2, ...)Get-Info
: display info about nodesInitialize-Kubeadm
: Initialize kubeadmStart-KubeadmJoin
: Run Kubeadm joind commandSave-KubeConfig
: Save Kube config to hostRestart-K8sVM
: Soft-reboot the nodesInvoke-Shutdown
: Soft-shutdown the nodesSave-K8sVM
: Snapshot the VMsRestore-K8sVM
: Restore VMs from latest snapshotsStop-K8sVM
: Stop the VMsStart-K8sVM
: Start the VMsRemove-K8sVM
: Stop VMs and delete the VM filesRemove-Network
: Delete the network