Skip to content

Instantly share code, notes, and snippets.

@ynwd
Last active December 21, 2022 12:52
Show Gist options
  • Save ynwd/e33a4eb0ea29fbd74bb6d07807866376 to your computer and use it in GitHub Desktop.
Save ynwd/e33a4eb0ea29fbd74bb6d07807866376 to your computer and use it in GitHub Desktop.
Alpine and Kubernetes in Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/alpine317"
config.vm.synced_folder ".", "/vagrant"
config.vm.network "forwarded_port", guest: 6443, host: 6443
config.vm.provider "virtualbox" do |vb|
vb.memory = 4096
vb.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
if ! type "kubectl" > /dev/null; then
curl -sfL https://get.k3s.io | sudo sh -
echo "waiting.."
sleep 10
cp /etc/rancher/k3s/k3s.yaml /vagrant/k3s.yaml
fi
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment