# kubectl create -f ./network.yaml
network "net1" created
# kubectl get network
NAME SUBNETS PROVIDERNETWORKID LABELS STATUS
net1 192.168.0.0/24 <none> Active
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
# kubectl create -f ./namespace.yaml
namespace "ns1" created
# kubectl get namespace
NAME LABELS STATUS AGE
default <none> Active 30d
ns1 <none> Active 6m
Manage Pod
Create Pod spec pod-ns1.yaml and set its namespace to ns1
# kubectl create -f ./pod-ns1.yaml
pod "nginx" created
# kubectl --namespace=ns1 get pod
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 2m
Manage Pod with Cinder volume
Hypernetes Volumes 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
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):
# kubectl create -f ./nginx-ns1.yaml
service "nginx" created
# kubectl --namespace=ns1 get svc nginx
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
nginx 10.254.223.206 8078/TCP app=nginx 10m
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