Created
April 20, 2018 15:55
-
-
Save neilus/62e639ae54c3815d6e52ec903a9a3490 to your computer and use it in GitHub Desktop.
Minikube Vagrantfile
This file contains 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
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/xenial64" | |
config.vm.define "minikube" do |kube| | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = "4096" | |
vb.cpus = "4" | |
end | |
config.vm.network "forwarded_port", | |
guest: 30000, | |
host: 30000, | |
auto_correct: true | |
config.vm.network "forwarded_port", | |
guest: 80, | |
host: 80, | |
auto_correct: true | |
config.vm.network "forwarded_port", | |
guest: 443, | |
host: 443, | |
auto_correct: true | |
config.vm.provision "kubectl", type: "shell", inline: <<-SCRIPT | |
echo "Installing kubectl" | |
apt-get -qq update && apt-get install -qqy apt-transport-https | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubectl.list | |
apt-get update -qq | |
apt-get install -qqy kubectl | |
SCRIPT | |
config.vm.provision "docker", type: "shell", inline: <<-SCRIPT | |
sudo apt-get remove docker docker-engine docker.io | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
sudo apt-get update -qq | |
sudo apt-get install -yqq docker-ce | |
usermod -aG docker vagrant | |
sudo docker run hello-world | |
SCRIPT | |
config.vm.provision "minikube", type: "shell", inline: <<-SCRIPT | |
echo "Downloading minikube" | |
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.26.1/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ | |
SCRIPT | |
config.vm.provision "k8s", type: "shell", inline: <<-SCRIPT | |
echo "Setting up and starting K8S" | |
minikube start --vm-driver none | |
minikube dashboard --url | |
kubectl cluster-info | |
SCRIPT | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment