Skip to content

EtienneDeneuve/kubernetes_hyperv

Repository files navigation

HitCount

Create a Kubernetes Cluster on Hyper V

Latest changes

  • You don't need WSL in 2019 VM, you need just to configure WinRM on the Hyper-V and add the IP in inventory\host, and WSL a mac or linux for launching the playbook
  • Added Group Vars in Part 5, so you don't need to change multiple stuff
  • I'm working on the project to add a way to change number of each type of Kubernetes nodes - WIP

Prerequisites

You need a Windows Server 2019 VM with nested virtualization enabled at least 8 Go of Ram in the VM:
Setup Guide for Hyper V

TL&DR

On the 2019 VM host :

  1. Install WSL
  2. Hyper V
  3. Activate WinRM
  4. Install packer.

In WSL:

  1. Install the dependencies
  2. Clone the project git clone https://github.com/EtienneDeneuve/kubernetes_hyperv/kubernetes_hyperv.git
  3. Update the credential for hyperv in inventory/hosts.yml
  4. Launch the playbook in main : ansible-playbook -i inventory/hosts.yml main/playbook.yml
  5. SSH into the master node and start playing with your Kubernetes Cluster !

TODO

  • Add Tests with Molecule
  • Add Tests with Pester
  • Add Tests for Packer image generation
  • Configure CI/CD for test
  • Add others distro for base os in Kubernetes
  • Hardening and avoid snowflake
  • Create box with Vagrant for Hyper V VM

WSL installation

For Windows 10

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Then for Windows 10 and Windows Server 2019

Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.zip -UseBasicParsing
Expand-Archive .\Ubuntu.zip c:\Distros\Ubuntu
Rename-Item c:\distros\ubuntu\ubuntu1804.exe c:\distros\ubuntu\ubuntu.exe

Configure WinRM for Ansible in Windows 2019 VM

Launch this script :
ConfigureRemotingForAnsible or use the one in misc folder : here

Install Ansible in WSL

Launch the 04_configure.sh script in misc\wsl_preparation: sudo .\04_configure.sh

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

About

Quick setup of a K8S Cluster in Hyper V server

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published