Add developer guide

This commit adds the developer guide for stackube.

Change-Id: If32602d93929f9452e447959265b21335d13f622
Signed-off-by: Pengfei Ni <feiskyer@gmail.com>
This commit is contained in:
Pengfei Ni 2017-06-23 16:01:14 +08:00
parent b95dd6a380
commit 01460635d9
2 changed files with 72 additions and 0 deletions

View File

@ -13,3 +13,11 @@ Stackube Scope
stackube_scope_clarification
Developer Guide
================
.. toctree::
:maxdepth: 2
setup

64
doc/source/setup.rst Normal file
View File

@ -0,0 +1,64 @@
Setting Up a Development Environment
=====================================
This page describes how to setup a working development environment that can be used in developing stackube on Ubuntu or CentOS. These instructions assume you're already installed git, golang and python on your host.
=================
Getting the code
=================
Grab the code:
::
git clone git://git.openstack.org/openstack/stackube
==================================
Spawn up Kubernetes and OpenStack
==================================
devstack is used to spawn up a kubernetes and openstack environment.
Create stack user:
::
sudo useradd -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
sudo su - stack
Grab the devstack:
::
git clone https://git.openstack.org/openstack-dev/devstack -b stable/ocata
cd devstack
Create a local.conf:
::
curl -sSL https://raw.githubusercontent.com/openstack/stackube/master/devstack/local.conf.sample -o local.conf
Start installation:
::
./stack.sh
Setup environment variables for kubectl and openstack client:
::
export KUBECONFIG=$HOME/admin.conf
source openrc admin admin
================
Add a new node
================
Same procedure as above, but create the local.conf by following command:
::
curl -sSL https://raw.githubusercontent.com/openstack/stackube/master/devstack/local.conf.node.sample -o local.conf
And configure local.conf:
- Set `HOST_IP` to local host's IP
- Set `SERVICE_HOST` to master's IP
- Set `KUBEADM_TOKEN` to kubeadm token