Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 18 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down