{"id":14064647,"url":"https://github.com/EtienneDeneuve/kubernetes_hyperv","last_synced_at":"2025-07-29T18:33:41.385Z","repository":{"id":141640937,"uuid":"162427663","full_name":"EtienneDeneuve/kubernetes_hyperv","owner":"EtienneDeneuve","description":"Quick setup of a K8S Cluster in Hyper V server","archived":false,"fork":false,"pushed_at":"2019-06-07T14:51:04.000Z","size":82,"stargazers_count":18,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-14T07:07:23.151Z","etag":null,"topics":["ansible","dsc","hyperv","packer","wsl"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EtienneDeneuve.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-12-19T11:26:20.000Z","updated_at":"2024-07-26T16:03:22.000Z","dependencies_parsed_at":"2024-02-15T00:46:52.603Z","dependency_job_id":null,"html_url":"https://github.com/EtienneDeneuve/kubernetes_hyperv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtienneDeneuve%2Fkubernetes_hyperv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtienneDeneuve%2Fkubernetes_hyperv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtienneDeneuve%2Fkubernetes_hyperv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EtienneDeneuve%2Fkubernetes_hyperv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EtienneDeneuve","download_url":"https://codeload.github.com/EtienneDeneuve/kubernetes_hyperv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228040776,"owners_count":17860211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","dsc","hyperv","packer","wsl"],"created_at":"2024-08-13T07:03:59.241Z","updated_at":"2024-12-04T03:31:15.461Z","avatar_url":"https://github.com/EtienneDeneuve.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"\r\n[![HitCount](http://hits.dwyl.io/etiennedeneuve/kubernetes_hyperv.svg)](http://hits.dwyl.io/etiennedeneuve/kubernetes_hyperv)\r\n\r\n# Create a Kubernetes Cluster on Hyper V\r\n\r\n## Latest changes\r\n\r\n- 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\r\n- Added Group Vars in Part 5, so you don't need to change multiple stuff\r\n- I'm working on the project to add a way to change number of each type of Kubernetes nodes - WIP\r\n\r\n## Prerequisites\r\n\r\nYou need a Windows Server 2019 VM with nested virtualization enabled at least 8 Go of Ram in the VM:  \r\n    [Setup Guide for Hyper V](https://docs.microsoft.com/fr-fr/virtualization/hyper-v-on-windows/user-guide/nested-virtualization)\r\n\r\n## TL\u0026DR\r\n\r\nOn the 2019 VM host :\r\n\r\n1. ~~Install [WSL](#WSL)~~\r\n1. ~~[Hyper V](#Hyper-V)~~\r\n2. Activate [WinRM](#Configure-WinRM-for-Ansible)\r\n3. ~~Install [packer](https://packer.io/downloads).~~\r\n\r\nIn WSL:\r\n\r\n1. Install the [dependencies](#Install-Ansible-in-WSL)\r\n1. Clone the project ``git clone https://github.com/EtienneDeneuve/kubernetes_hyperv/kubernetes_hyperv.git``\r\n1. Update the credential for hyperv in ``inventory/hosts.yml``\r\n2. Launch the playbook in ``main`` : ``ansible-playbook -i inventory/hosts.yml main/playbook.yml``\r\n3. SSH into the master node and start playing with your Kubernetes Cluster !\r\n\r\n## TODO\r\n\r\n- [ ] Add Tests with [Molecule](https://molecule.readthedocs.io/en/latest/)\r\n- [ ] Add Tests with [Pester](https://github.com/pester/Pester)\r\n- [ ] Add Tests for Packer image generation\r\n- [ ] Configure CI/CD for test\r\n- [ ] Add others distro for base os in Kubernetes\r\n- [ ] Hardening and avoid snowflake \r\n- [ ] Create box with Vagrant for Hyper V VM\r\n  \r\n## WSL installation\r\n\r\nFor Windows 10\r\n\r\n```Powershell\r\nEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux\r\n```\r\n\r\nThen for Windows 10 and Windows Server 2019\r\n\r\n```Powershell\r\nInvoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.zip -UseBasicParsing\r\nExpand-Archive .\\Ubuntu.zip c:\\Distros\\Ubuntu\r\nRename-Item c:\\distros\\ubuntu\\ubuntu1804.exe c:\\distros\\ubuntu\\ubuntu.exe\r\n```\r\n\r\n## Configure WinRM for Ansible in Windows 2019 VM\r\n\r\nLaunch this script :  \r\n[ConfigureRemotingForAnsible](https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1\r\n)\r\nor use the one in misc folder : [here](webcast\\misc\\host_preparation\\01_config_winrm_ansible.ps1)\r\n\r\n## Install Ansible in WSL\r\n\r\nLaunch the ``04_configure.sh`` script in ``misc\\wsl_preparation``:\r\nsudo .\\04_configure.sh\r\n\r\n## Code of Conduct\r\nThis project has adopted the [Microsoft Open Source Code of\r\nConduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct\r\nFAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com)\r\nwith any additional questions or comments.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEtienneDeneuve%2Fkubernetes_hyperv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEtienneDeneuve%2Fkubernetes_hyperv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEtienneDeneuve%2Fkubernetes_hyperv/lists"}