User Guide

Client Installation

Install OpenStack Client

sudo pip install python-openstackclient

Setup OpenStack auth environment variables, such as

unset OS_SERVICE_TOKEN
export OS_USERNAME=username
export OS_PASSWORD=password
export OS_AUTH_URL=http://auth-server:5000/v2.0
export OS_TENANT_NAME=tenant-name
export OS_REGION_NAME=RegionOne

Install kubectl

Download kubernetes-client at https://github.com/hyperhq/hypernetes/releasesarrow-up-right and extract kubectl to your system PATH.

Setup kubectl options

kubectl config set-cluster default --server=http://kubernetes-master:8080 --insecure-skip-tls-verify=true
kubectl config set-context default --cluster=default
kubectl config use-context default

Manage network

Create network spec network.yaml with subnet 192.168.0.0/24

This operation will create a new Neutron network with a default router and a subnet 192.168.0.0/24 automatically.

Manage namespace

You can create a namespace with or without network. A namespace without network is only suggested for administration because there is no network isolation. For users, a network is required to create a namespace.

Create namespace spec namespace.yaml and set its network to net1

Manage Pod

Create Pod spec pod-ns1.yaml and set its namespace to ns1

Manage Pod with Cinder volume

Hypernetes Volumesarrow-up-right support native Cinder volumes (only rbd backend is supported now), which means that you can simply create a Pod with Cinder volume. A sample Pod with Cinder volume 651b2a7b-683e-47e1-bdd6-e3c62e8f91c0 is

Manage service

Create a service spec nginx-ns1.yaml with namespace ns1 and type NetworkProvider (Service must be type NetworkProvider if its namespace is with a network):

Cluster service 10.254.223.206:8078 can be only visited on Pods in namespace ns1.

Now let's create another service nginx2-ns1.yaml. It's the same configuration as nginx service, but with externalIP 23.23.0.30

Notes about service nginx2

  • Cluster service 10.254.154.51:8078 can be only visited on Pods in namespace ns1

  • External ip 192.168.0.4 can be visited on all Pods in the same network net1, since it is the vip internal load balancer's network

  • External ip 23.23.0.30 can be visited on public since it is a public IP

clean up

For a more detailed user guide, see Kubernetes user guidearrow-up-right

Last updated