From bf5c643ce17cb926383a2730769576d9a52f6296 Mon Sep 17 00:00:00 2001 From: Stacey Fletcher Date: Thu, 1 Jun 2017 18:29:11 -0500 Subject: [PATCH] Move dev directory contents and update VagrantFile This PS moves the dev contents to the tools directory as well as updates the VagrantFile to use the existing scripts for installing kubeadm-aio and deploying helm charts. Change-Id: I6768d1f96abe6b15f66931d543e9adcc0e82829b --- dev/README.rst | 55 ------------------------ dev/setup-dev-host.sh | 17 -------- doc/source/install/developer/vagrant.rst | 2 +- tools/vagrant/README.rst | 38 ++++++++++++++++ {dev => tools/vagrant}/Vagrantfile | 38 +++++----------- {dev => tools/vagrant}/config.rb | 0 6 files changed, 49 insertions(+), 101 deletions(-) delete mode 100644 dev/README.rst delete mode 100755 dev/setup-dev-host.sh create mode 100644 tools/vagrant/README.rst rename {dev => tools/vagrant}/Vagrantfile (79%) rename {dev => tools/vagrant}/config.rb (100%) diff --git a/dev/README.rst b/dev/README.rst deleted file mode 100644 index 6f68082e4b..0000000000 --- a/dev/README.rst +++ /dev/null @@ -1,55 +0,0 @@ -================== -Vagrant Deployment -================== - -Requirements ------------- - -* Hardware: - - * 16GB RAM - * 32GB HDD Space - -* Software - - * Vagrant >= 1.8.0 - * VirtualBox >= 5.1.0 - * Kubectl - * Helm - * Git - -Deploy ------- - -Make sure you are in the directory containing the Vagrantfile before -running the following commands. - -Create VM ---------- - -.. code:: bash - - vagrant up --provider virtualbox - -Deploy NFS Provisioner for development PVCs -------------------------------------------- - -.. code:: bash - - vagrant ssh --command "sudo docker exec kubeadm-aio kubectl create -R -f /opt/nfs-provisioner/" - -Setup Clients and deploy Helm's tiller --------------------------------------- - -.. code:: bash - - ./setup-dev-host.sh - -Label VM node(s) for OpenStack-Helm Deployment ----------------------------------------------- - -.. code:: bash - - kubectl label nodes openstack-control-plane=enabled --all --namespace=openstack - kubectl label nodes openvswitch=enabled --all --namespace=openstack - kubectl label nodes openstack-compute-node=enabled --all --namespace=openstack diff --git a/dev/setup-dev-host.sh b/dev/setup-dev-host.sh deleted file mode 100755 index 29f9ec90d9..0000000000 --- a/dev/setup-dev-host.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -e -# Setting up kubectl creds -mkdir -p ${HOME}/.kube -if [ -f ${HOME}/.kube/config ]; then - echo "Previous kube config found, backing it up" - mv -v ${HOME}/.kube/config ${HOME}/.kube/config.$(date "+%F-%T") -fi -echo "Getting kubeconfig from kube1" -vagrant ssh default -c "sudo cat /etc/kubernetes/admin.conf" > ${HOME}/.kube/config - -# Setting up helm client if present -if which helm 2>/dev/null; then - helm init -fi - -echo "clients should now be ready to access the Kubernetes cluster" diff --git a/doc/source/install/developer/vagrant.rst b/doc/source/install/developer/vagrant.rst index 4975e73dc6..a422b6ede6 100644 --- a/doc/source/install/developer/vagrant.rst +++ b/doc/source/install/developer/vagrant.rst @@ -1 +1 @@ -.. include:: ../../../../dev/README.rst +.. include:: ../../../../tools/vagrant/README.rst diff --git a/tools/vagrant/README.rst b/tools/vagrant/README.rst new file mode 100644 index 0000000000..a92e6a6901 --- /dev/null +++ b/tools/vagrant/README.rst @@ -0,0 +1,38 @@ +================== +Vagrant Deployment +================== + +Requirements +------------ + +* Hardware: + + * 16GB RAM + * 32GB HDD Space + +* Software + + * Vagrant >= 1.8.0 + * VirtualBox >= 5.1.0 + * Git + +Deploy +------ + +Make sure you are in the directory containing the Vagrantfile before +running the following commands. + +Create VM +--------- + +.. code:: bash + + vagrant up --provider virtualbox + +Validate helm charts are successfully deployed +---------------------------------------------- + +.. code:: bash + + vagrant ssh + helm list diff --git a/dev/Vagrantfile b/tools/vagrant/Vagrantfile similarity index 79% rename from dev/Vagrantfile rename to tools/vagrant/Vagrantfile index 6a3d091a20..9bd225fcae 100644 --- a/dev/Vagrantfile +++ b/tools/vagrant/Vagrantfile @@ -79,34 +79,16 @@ Vagrant.configure("2") do |config| # Mount Storage mount -a - - # Install requirements apt-get update - apt-get install -y \ - docker.io \ - nfs-common + apt-get install -y git +SHELL + config.vm.provision "shell", privileged: false, inline: <<-SHELL + #Cloning repo + git clone https://git.openstack.org/openstack/openstack-helm - # Setup kubelet lib as shared mount - mkdir -p /var/lib/kublet - mount --bind /var/lib/kublet /var/lib/kublet - mount --make-shared /var/lib/kublet - - # Run AIO container - docker run \ - -dt \ - --name=kubeadm-aio \ - --net=host \ - --security-opt=seccomp:unconfined \ - --cap-add=SYS_ADMIN \ - --tmpfs=/run \ - --tmpfs=/run/lock \ - --volume=/etc/machine-id:/etc/machine-id:ro \ - --volume=/home:/home:rw \ - --volume=/etc/kubernetes:/etc/kubernetes:rw \ - --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro \ - --volume=/var/run/docker.sock:/run/docker.sock \ - --env KUBE_BIND_DEV=enp0s8 \ - --env KUBELET_CONTAINER=quay.io/attcomdev/kubeadm-aio:v1.5.6 \ - quay.io/attcomdev/kubeadm-aio:v1.5.6 - SHELL + cd openstack-helm + export INTEGRATION='aio' + export INTEGRATION_TYPE='basic' + ./tools/gate/setup_gate.sh +SHELL end diff --git a/dev/config.rb b/tools/vagrant/config.rb similarity index 100% rename from dev/config.rb rename to tools/vagrant/config.rb