diff --git a/README.md b/README.md index b1de4db..be5f21a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ See https://www.itwonderlab.com/en/ansible-kubernetes-vagrant-tutorial/ ------------------ +## For Windows users +It is possible to execute the provisioning by leveraging the WSL2 sharing functionalities of Windows. Take a look [here](https://gist.github.com/pr3l14t0r/8b350fc7052ccee30a456596fa017c33) for further requirements and explanation. +Uncomment the Windows related lines in the Vagrantfile in order to inject a ssh key from your WSL2 distribution into the VMs. + ## Creación de un Clúster de Kubernetes 1.22 Containerd e Istio usando Vagrant y Ansible (1 maestro N nodos) Creación de un **clúster Kubernetes con múltiples nodos usando Vagrant, Ansible y Virtualbox**. Especialmente indicado para entornos de desarrollo local realistas. diff --git a/Vagrantfile b/Vagrantfile index 10655e3..2dea551 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -12,9 +12,27 @@ IP_BASE = "192.168.50." VAGRANT_DISABLE_VBOXSYMLINKCREATE=1 +# Windows WSL users should use an own ssh private key and inject its corresponding public-key into the VM. +# uncomment the next line, providing a path to your ssh private key within the WSL2 distro +#SECURE_SSH_PRIVATE_KEY = "~/.ssh/NewKey" + Vagrant.configure("2") do |config| config.ssh.insert_key = false + # Insert own ssh key to the machines. + # Taken from: https://stackoverflow.com/questions/30075461/how-do-i-add-my-own-public-key-to-vagrant-vm + # uncomment the next block + + #vagrant_home_path = ENV["VAGRANT_HOME"] ||= "~/.vagrant.d" + #config.ssh.private_key_path = ["#{vagrant_home_path}/insecure_private_key", "#{SECURE_SSH_PRIVATE_KEY}"] + + #config.vm.provision "file", source: "#{SECURE_SSH_PRIVATE_KEY}.pub", destination: "/home/vagrant/.ssh/SecureKey.pub" + #config.vm.provision :shell, privileged: false do |shell_action| + # shell_action.inline = <<-SHELL + # cat /home/vagrant/.ssh/SecureKey.pub >> /home/vagrant/.ssh/authorized_keys + # SHELL + # end + (1..MASTERS_NUM).each do |i| config.vm.define "k8s-m-#{i}" do |master| master.vm.box = IMAGE_NAME