From 4dd67bf6ab97ef7de7243e4ddd6b885b53859d66 Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Thu, 3 Aug 2017 21:40:31 +0800 Subject: [PATCH] Update documentation Change-Id: Ib135d350d48452fc986ccfcdbfd4f04e4a29b28b --- doc/source/architecture.rst | 39 ++++++ doc/source/developer.rst | 230 +++++++++++++++++++++++++++--------- doc/source/index.rst | 3 +- doc/source/setup.rst | 8 +- 4 files changed, 224 insertions(+), 56 deletions(-) diff --git a/doc/source/architecture.rst b/doc/source/architecture.rst index e69de29..89717f6 100644 --- a/doc/source/architecture.rst +++ b/doc/source/architecture.rst @@ -0,0 +1,39 @@ +Stackube Architecture +======================= + +This page describes the architecture of stackube. + +========== +Overview +========== + +Stackube is a Kubernetes-centric OpenStack distro. It uses Kubernetes, instead of Nova, as the compute +fabric controller, to provision containers as the compute instance, along with other OpenStack +services (e.g. Cinder, Neutron). It supports multiple container runtime technologies, e.g. Docker, +Hyper, and offers built-in soft/hard multi-tenancy (depending on the container runtime used). + +=========== +Components +=========== + +#. Standard OpenStack Compoents + +* OpenStack Keytone +* OpenStack Neutron +* OpenStack Cinder + +#. Standard Kubernetes Components + +* Etcd: the storage of kubernetes. +* Kube-apiserver: the API, authn/authz and admission control of kubernetes. +* Kuber-controller-manager: the brain of kubernetes, ensure the state of kubernetes cluster. +* Kube-scheduler: the scheduler of kubernetes. +* Kubelet: the container lifecycle and volume manager of kubernetes. +* Frakti&HyperContainer: a hypervisor-based container runtime. +* Docker: docker container runtime. + +#. Stackube addons + +* Stackube-controller: tenant and network manager. +* Stackube-proxy: service discovery and load balancing, replacement of kube-proxy. +* Kubestack: the CNI network plugin, which connects containers to Neutron network. diff --git a/doc/source/developer.rst b/doc/source/developer.rst index 33bc919..01ca119 100644 --- a/doc/source/developer.rst +++ b/doc/source/developer.rst @@ -1,60 +1,120 @@ -Developer Document +Deployment Documentation ===================================== -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. +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. -================= -Stackube controller -================= - --------- +========= Build --------- +========= + +Build binary: :: - make build + make The binary will be placed at: :: + _output/kubestack _output/stackube-controller + _output/stackube-proxy --------- -Start --------- +Build docker images: :: + make docker + +Three docker images will be built: + +:: + + stackube/stackube-proxy:v0.1 + stackube/stackube-controller:v0.1 + stackube/kubestack:v0.1 + +========= +Start +========= + +The following parts suppose you have already deployed an environment of OpenStack and Kubernetes on same baremetal host. +If the cluster is not deployed via devstack, don't forget to setup `--experimental-keystone-url` for kube-apiserver, e.g. + +:: + + kube-apiserver --experimental-keystone-url=https://192.168.128.66:5000/v2.0 ... + +Remove kube-dns deployment and kube-proxy daemonset if you have already running them. + +:: + + kubectl -n kube-system delete deployment kube-dns + kubectl -n kube-system delete daemonset kube-proxy + +If you have also configured a CNI network plugin, you should also remove it togather with CNI network config. + +:: + + # Remove CNI network components, e.g. deployments or daemonsets first. + # Then remove CNI network config. + rm -f /etc/cni/net.d/* + +Then create external network in Neutron if there is no one. + +:: + + # Create an external network if there is no one. # Please replace 10.123.0.x with your own external network # and remember the id of your created external network neutron net-create br-ex --router:external=True --shared neutron subnet-create --ip_version 4 --gateway 10.123.0.1 br-ex 10.123.0.0/16 --allocation-pool start=10.123.0.2,end=10.123.0.200 --name public-subnet - # Create configure file for Stackube - cat >/etc/stackube.conf </identity_admin/v2.0 - username = admin - password = password - tenant-name = admin - region = RegionOne - ext-net-id = + +Now, we are ready to deploy stackube components. + +First create configure file for Stackube. + +:: + + # Remember to replace them with your own ones. + cat >stackube-configmap.yaml < + + + Welcome to nginx! + + + +

Welcome to nginx!

+

If you see this page, the nginx web server is successfully installed and + working. Further configuration is required.

+ +

For online documentation and support please refer to + nginx.org.
+ Commercial support is available at + nginx.com.

+ +

Thank you for using nginx.

+ + + - 100% |*********************************************************************| 612 0:00:00 ETA + / # + +6. Finally, remove the tenant. + +:: + + $ kubectl delete tenant test + tenant "test" deleted + +7. Check Network in Neutron is also deleted by Stackube controller :: diff --git a/doc/source/index.rst b/doc/source/index.rst index c593463..ef6f195 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -5,12 +5,13 @@ Welcome to Stackube developer documentation! Stackube is a multi-tenant and secure Kubernetes deployment enabled by OpenStack core components. -Stackube Scope +Introduction ============== .. toctree:: :maxdepth: 2 + architecture stackube_scope_clarification Developer Guide diff --git a/doc/source/setup.rst b/doc/source/setup.rst index 9044173..7be3553 100644 --- a/doc/source/setup.rst +++ b/doc/source/setup.rst @@ -1,7 +1,8 @@ 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. +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 @@ -61,3 +62,8 @@ 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 + +Start installation: +:: + + ./stack.sh