Winspray is set of functions made to ease Kubernetes install on Hyperv via Vagrant and kubespray
Goal :
- multi-node
- multi OS
- easy config
- no effort / repeatable
Compatible Vagrant boxes :
- "generic/centos8"
- "generic/debian10"
- "generic/ubuntu1910"
Latest Vagrant must be installed.
Latest Docker Destkop must be installed.
Ensure you're not connected into any kind of VPN or you'll probably get into troubles.
Import from Powershell Gallery :
Install-Module -Name winspray
Choose your infra : pick one config file on winspray github repo. You can edit and create your own.
Create your cluster with New-Winspray-Cluster
command. In this example, "minimal.yaml" infra is used :
New-Winspray-Cluster .\minimal.yaml
First installation may take as long as one hour, depending on your Internet connexion. Next install usually takes from a quarter to 25 minutes.
Restore-Winspray-Cluster # Restore all VMs to snapshot created right after installation is OK
Stop-Winspray-Cluster
Start-Winspray-Cluster
Remove-Winspray-Cluster
New-Winspray-Cluster .\mynewcluster.yaml
# or New-Winspray-Cluster .\mynewcluster.yaml -Force
Get-Help winspray
Since kubespray signs SSL certificates with IPs, and Hyperv defaults VMs with dynamic IPs and MACs, Winspray adds a secondary inteface, dedicated to kubernetes control-plane, with static IPs.
This chart exposes behaviour of New-Winspray-Cluster
with sub functions calls.
winspray
New-Winspray-Cluster Vagrant docker container HyperV VMS
| | | | |
Test- | |---------| | | | |
Winspray- | | | check env | | | |
Env | |---------- | | | |
| | | | |
| run playbook "create" | | |
New- | --------------------------------------------------------->| | |
Winspray- | | | | | |
Inventory | | Vagrantfile and kubespray inventory | | |
|<--------------------------------------------------------| | |
| | | | |
| launch vagrant up | | | |
|------------------------------->| create VMs with additional interface | |
| |----------------------------------------------->| |
| | | | VMs are |
| | VMs created ok | now created |
| |<-----------------------------------------------| |
| ok good to go | | | |
|<------------------------------ | | | |
| | | | |
| run playbook "prepare" | | |
| |-------------------------------------------------------->| | |
| | | | prepare netwok |
Prepare- | | | |--------------------------------------------->|
Winspray- | | | | | |
Cluster | | | | network ok |
| | good to go |<---------------------------------------------|
| |<--------------------------------------------------------| | |
| | | | |
| launch kubespray "cluster" playbook | | |
| |-------------------------------------------------------->| | |
| | | | do all the kubespray magic |
Install- | | | |--------------------------------------------->|
Winspray- | | | | | |
Cluster | | | | kubespray install done |
| | THE END | |<---------------------------------------------|
| |<--------------------------------------------------------| | |
| | | | |
Note : hyperv snapshots are taken at the end of Prepare-Winspray-Cluster
function and another one after Install-Winspray-Cluster
.
yourpath:.
├───.vagrant # <- internal vagrant files
├───current
│ ├───config # <- kubespray config copied from winspray docker image. Overrides default `group_vars`
│ ├───credentials # <- kubespray gathered credentials
│ └───group_vars # <- default group_vars copied from kubespray defaults
├───kubespray_cache # <- downloaded binaries and docker images for kubespray. Kept for faster re-install.