Last active
December 21, 2022 12:52
-
-
Save ynwd/e33a4eb0ea29fbd74bb6d07807866376 to your computer and use it in GitHub Desktop.
Alpine and Kubernetes in Vagrant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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