-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Former-commit-id: 98610e96317e731d4eb1b7e4bcf985ad4357f716 [formerly cd7dea0] Former-commit-id: 3b3966f9ff8ea17c8d403dfde8021a053e4716f1
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "ubuntu/xenial64" | ||
config.vm.hostname = 'dev' | ||
|
||
config.vm.provision "shell", privileged: false, inline: <<-SHELL | ||
set -e -x -u | ||
sudo apt-get update | ||
sudo apt-get install -y vim git build-essential openvswitch-switch tcpdump unzip tig | ||
# Env for proto | ||
PROTOC_RELEASE="https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip" | ||
PROTOC_TARGET="${HOME}/protoc" | ||
# Install Docker | ||
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 | ||
sudo apt-get install -y docker-ce=17.03.2~ce-0~ubuntu-xenial | ||
# Install Kubernetes | ||
sudo apt-get install -y apt-transport-https curl | ||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | ||
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee --append /etc/apt/sources.list.d/kubernetes.list | ||
sudo apt-get update | ||
sudo apt-get install -y kubelet kubeadm kubectl | ||
sudo swapoff -a | ||
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 | ||
mkdir -p $HOME/.kube | ||
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config | ||
sudo chown $(id -u):$(id -g) $HOME/.kube/config | ||
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml | ||
kubectl taint nodes --all node-role.kubernetes.io/master- | ||
# Install Golang | ||
wget --quiet https://storage.googleapis.com/golang/go1.10.2.linux-amd64.tar.gz | ||
sudo tar -zxf go1.10.2.linux-amd64.tar.gz -C /usr/local/ | ||
echo 'export GOROOT=/usr/local/go' >> /home/$USER/.bashrc | ||
echo 'export GOPATH=$HOME/go' >> /home/$USER/.bashrc | ||
echo 'export PATH=/home/$USER/protoc/bin:$PATH:$GOROOT/bin:$GOPATH/bin' >> /home/$USER/.bashrc | ||
export GOROOT=/usr/local/go | ||
export GOPATH=$HOME/go | ||
export PATH=/home/$USER/protoc/bin:$PATH:$GOROOT/bin:$GOPATH/bin | ||
# setup golang dir | ||
mkdir -p /home/$USER/go/src | ||
rm -rf /home/$USER/go1.10.2.linux-amd64.tar.gz | ||
# install protoc | ||
if [ ! -d "${PROTOC_TARGET}" ]; then curl -fsSL "$PROTOC_RELEASE" > "${PROTOC_TARGET}.zip"; fi | ||
if [ -f "${PROTOC_TARGET}.zip" ]; then unzip "${PROTOC_TARGET}.zip" -d "${PROTOC_TARGET}"; fi | ||
go get -u github.com/golang/protobuf/{proto,protoc-gen-go} | ||
SHELL | ||
|
||
config.vm.provider :virtualbox do |v| | ||
v.customize ["modifyvm", :id, "--cpus", 2] | ||
v.customize ["modifyvm", :id, "--memory", 1024] | ||
v.customize ['modifyvm', :id, '--nicpromisc1', 'allow-all'] | ||
end | ||
end | ||
|