From b5f2330198ba9eb581972f1f394f7cf8c3ed2db8 Mon Sep 17 00:00:00 2001 From: Yapeng Wu Date: Thu, 18 Jan 2018 20:10:06 +0000 Subject: Add istio 0.4 installation on top of k8s 1.9 Based on k8s 1.9 (kubeadm_basic) installation, adding the istio 0.4 installation and simple validation. Change-Id: Iee2c71974fb2b33df0f9342e0bfd9e96e4dab8f5 Signed-off-by: Yapeng Wu --- src/vagrant/kubeadm_istio/Vagrantfile | 29 ++++++++++++++++ src/vagrant/kubeadm_istio/deploy.sh | 12 +++++++ src/vagrant/kubeadm_istio/host_setup.sh | 29 ++++++++++++++++ src/vagrant/kubeadm_istio/istio/bookinfo.sh | 41 +++++++++++++++++++++++ src/vagrant/kubeadm_istio/istio/clean_bookinfo.sh | 27 +++++++++++++++ src/vagrant/kubeadm_istio/istio/deploy.sh | 39 +++++++++++++++++++++ src/vagrant/kubeadm_istio/master_setup.sh | 10 ++++++ src/vagrant/kubeadm_istio/worker_setup.sh | 4 +++ 8 files changed, 191 insertions(+) create mode 100644 src/vagrant/kubeadm_istio/Vagrantfile create mode 100755 src/vagrant/kubeadm_istio/deploy.sh create mode 100644 src/vagrant/kubeadm_istio/host_setup.sh create mode 100755 src/vagrant/kubeadm_istio/istio/bookinfo.sh create mode 100755 src/vagrant/kubeadm_istio/istio/clean_bookinfo.sh create mode 100755 src/vagrant/kubeadm_istio/istio/deploy.sh create mode 100644 src/vagrant/kubeadm_istio/master_setup.sh create mode 100644 src/vagrant/kubeadm_istio/worker_setup.sh (limited to 'src/vagrant') diff --git a/src/vagrant/kubeadm_istio/Vagrantfile b/src/vagrant/kubeadm_istio/Vagrantfile new file mode 100644 index 0000000..9f78e9f --- /dev/null +++ b/src/vagrant/kubeadm_istio/Vagrantfile @@ -0,0 +1,29 @@ +$num_workers=2 + +Vagrant.require_version ">= 1.8.6" +Vagrant.configure("2") do |config| + + config.vm.box = "ceph/ubuntu-xenial" + config.vm.provider :libvirt do |libvirt| + libvirt.memory = 4096 + libvirt.cpus = 4 + end + + config.vm.synced_folder "../..", "/src" + config.vm.provision "shell", path: "host_setup.sh", privileged: false + + config.vm.define "master" do |config| + config.vm.hostname = "master" + config.vm.provision "shell", path: "master_setup.sh", privileged: false + config.vm.network :private_network, ip: "192.168.1.10" + end + + (1 .. $num_workers).each do |i| + config.vm.define vm_name = "worker%d" % [i] do |config| + config.vm.hostname = vm_name + config.vm.provision "shell", path: "worker_setup.sh", privileged: false + config.vm.network :private_network, ip: "192.168.1.#{i+20}" + end + end + +end diff --git a/src/vagrant/kubeadm_istio/deploy.sh b/src/vagrant/kubeadm_istio/deploy.sh new file mode 100755 index 0000000..d947645 --- /dev/null +++ b/src/vagrant/kubeadm_istio/deploy.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -ex +DIR="$(dirname `readlink -f $0`)" + +cd $DIR +../cleanup.sh +vagrant up +vagrant ssh master -c "/vagrant/istio/deploy.sh" +vagrant ssh master -c "/vagrant/istio/bookinfo.sh" +vagrant ssh master -c "/vagrant/istio/clean_bookinfo.sh" + diff --git a/src/vagrant/kubeadm_istio/host_setup.sh b/src/vagrant/kubeadm_istio/host_setup.sh new file mode 100644 index 0000000..c1a23eb --- /dev/null +++ b/src/vagrant/kubeadm_istio/host_setup.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -ex + +cat << EOF | sudo tee /etc/hosts +127.0.0.1 localhost +192.168.1.10 master +192.168.1.21 worker1 +192.168.1.22 worker2 +192.168.1.23 worker3 +EOF + +sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D +sudo apt-key adv -k 58118E89F3A912897C070ADBF76221572C52609D +cat << EOF | sudo tee /etc/apt/sources.list.d/docker.list +deb [arch=amd64] https://apt.dockerproject.org/repo ubuntu-xenial main +EOF + +curl -s http://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - +cat <