Skip to content

Instantly share code, notes, and snippets.

@varunpalekar
Last active August 2, 2018 12:14
Show Gist options
  • Save varunpalekar/52dddbfa16961f634becc9ef11b26329 to your computer and use it in GitHub Desktop.
Save varunpalekar/52dddbfa16961f634becc9ef11b26329 to your computer and use it in GitHub Desktop.
kubernetes

Installing minikube with vagrant

  1. Install vagrant-timezone plugin for vagrant to sync time
  2. Have following vagrant file
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/xenial64"
  if Vagrant.has_plugin?("vagrant-timezone")
    config.timezone.value = :host
  end
  config.vm.network "private_network", ip: "192.168.99.100"

  config.vm.provider "virtualbox" do |vb|
    vb.memory = "8192"
    vb.cpus = 6
  end

  config.vm.provision "shell", inline: <<-SHELL
    apt-get update
    set -x ; set -e
    apt-get install -y apt-transport-https ca-certificates curl software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
    add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    apt-get update
    apt-get install docker-ce socat nfs-common -y
    curl -sLo minikube https://storage.googleapis.com/minikube/releases/v0.28.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
    minikube start --bootstrapper=kubeadm --vm-driver=none --kubernetes-version v1.9.5 --apiserver-ips=192.168.99.100 --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=Webhook
    curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
    cp ~/.minikube/ca.crt /vagrant/ ; cp ~/.minikube/client.* /vagrant
  SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment