Skip to content

Instantly share code, notes, and snippets.

@p-le
Created October 4, 2020 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p-le/f8e338efe12f3a73e19639f9142f4992 to your computer and use it in GitHub Desktop.
Save p-le/f8e338efe12f3a73e19639f9142f4992 to your computer and use it in GitHub Desktop.
Vagrantfile + Minikube
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/bionic64"
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.20"
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.cpus = 2
vb.memory = "2048"
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update -y
# 1. Install Minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube
mkdir -p /usr/local/bin/
install minikube /usr/local/bin/
# 2. Install Docker
apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update -y
apt-get -y install docker-ce docker-ce-cli containerd.io
# 3. Install kubectl
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
# 4. Add vagrant to docker group
addgroup -a vagrant docker
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment