Deployment Documentation

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.


Build binary:


The binary will be placed at:


Build docker images:

make docker

Three docker images will be built:



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= ...

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 br-ex --allocation-pool start=,end= --name public-subnet

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 <<EOF
kind: ConfigMap
apiVersion: v1
  name: stackube-config
  namespace: kube-system
  auth-url: ""
  username: "admin"
  password: "admin"
  tenant-name: "admin"
  region: "RegionOne"
  ext-net-id: "550370a3-4fc2-4494-919d-cae33f5b3de8"
  plugin-name: "ovs"
  integration-bridge: "br-int"
  user-cidr: ""
  user-gateway: ""
  kubernetes-host: ""
  kubernetes-port: "6443"

Then deploy stackube components:

kubectl create -f stackube-configmap.yaml
kubectl create -f deployment/stackube-proxy.yaml
kubectl create -f deployment/stackube.yaml


  1. Create a new tenant
$ cat test-tenant.yaml

apiVersion: ""
kind: Tenant
  name: test
  username: "test"
  password: "password"

$ kubectl create -f test-tenant.yaml
  1. Check the auto-created namespace and network. Wait a while, the namespace and network for this tenant should be created automatically:
$ kubectl get namespace test
test     Active    58m

$ kubectl -n test get network test -o yaml
kind: Network
  clusterName: ""
  creationTimestamp: 2017-08-03T11:58:31Z
  generation: 0
  name: test
  namespace: test
  resourceVersion: "3992023"
  selfLink: /apis/
  uid: 11d452eb-7843-11e7-8319-68b599b7918c
  networkID: ""
  state: Active
  1. Check the Network and Tenant created in Neutron by Stackube controller.
$ source ~/keystonerc_admin
$ neutron net-list
| id                                   | name                 | tenant_id                        | subnets                                                  |
| 421d913a-a269-408a-9765-2360e202ad5b | kube-test-test       | 915b36add7e34018b7241ab63a193530 | bb446a53-de4d-4546-81fc-8736a9a88e3a       |
  1. Check the kube-dns pods created in the new namespace.
# kubectl -n test get pods
NAME                        READY     STATUS    RESTARTS   AGE
kube-dns-1476438210-37jv7   3/3       Running   0          1h
  1. Create pods and services in the new namespace.
# kubectl -n test run nginx --image=nginx
deployment "nginx" created
# kubectl -n test expose deployment nginx --port=80
service "nginx" exposed

# kubectl -n test get pods -o wide
NAME                        READY     STATUS    RESTARTS   AGE       IP            NODE
kube-dns-1476438210-37jv7   3/3       Running   0          1h    stackube
nginx-4217019353-6gjxq      1/1       Running   0          27s   stackube

# kubectl -n test run -i -t busybox --image=busybox sh
If you don't see a command prompt, try pressing enter.
/ # nslookup nginx
Address 1:

Name:      nginx
Address 1: nginx.test.svc.cluster.local

/ # wget -O- nginx
Connecting to nginx (
<!DOCTYPE html>
<title>Welcome to nginx!</title>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href=""></a>.<br/>
Commercial support is available at
<a href=""></a>.</p>

<p><em>Thank you for using nginx.</em></p>
-                    100% |*********************************************************************|   612   0:00:00 ETA
/ #
  1. Finally, remove the tenant.
$ kubectl delete tenant test
tenant "test" deleted
  1. Check Network in Neutron is also deleted by Stackube controller
$ neutron net-list
| id                                   | name    | tenant_id                        | subnets                                                  |
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.