You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

UNDER CONSTRUCTION - SERVICE IS NOT AVAILABLE YET

What?

Openstack Magnum is the Container Infrastructure service, which gives you the possibility to create container clusters like docker-swarm and kubernetes as native resources in Openstack. For more information about the service, and offical documentaions, read the user guide and the Magnum Wiki page

How?

First...

If you want to use the openstack CLI on your local system, use the lastet version of python-magnumclient from pip3. Some popular distros has an old version in its repositories, and are known to not work properly. Be sure that your version has this commit included. On NTNUs logon servers, you should not worry. We've made sure we have the correct version (smile)

Cluster Templates

To get you started, there is a few public Cluster Templates available in our cloud. These are verified working by us.

NameOSMaster flavorNode flavor
kubernetes-templateFedora AtomicHost 29m1.smallt1.large
kubernetes-template-haFedora AtomicHost 29

docker-swarm-templateFedora AtomicHost 29

docker-swarm-template-haFedora AtomicHost 29

For more information, all templates can be listed with

$ openstack coe cluster template list
# And then
$ openstack coe cluster template show <id|name>
# To view details

Private templates can be created by users. Please consult the documentation to find which parameters is needed for different Container Orchestration Engines.

We know that Fedora AtomicHost 29 is deprecated and EoL, but support for Fedora CoreOS was added in Openstack Train. We are currently running Openstack Stein (one version older), but we are planning updates.


Create a cluster

The different container orchestration engines has different parameters. For an extensive and complete list, check the documentation.

Examples

For each template, you can override a few parameters when you create your cluster:

ParameterComment
--docker-volume-sizeSize of cinder volume housing docker images and volumes. Defaults to 40GB for our public templates
--master-flavorInstance flavor of VMs running the master node. Defaults to m1.small for public templates
--flavorInstance flavor of VMs runnin worker nodes. Defaults to t1.large for public templates
--labels

Override default labels for the give COE. Consult documentation for valid labels for each COE.

Note the labels set in the public templates are there for a reason (wink)

Also note that --labels does not merge, so if you want to add labels, please include the labels set in the template as well.



Docker Swarm

This will create Docker Swarm cluster with one master node, and one worker node

openstack coe cluster create <clustername> --cluster-template docker-swarm-template --master-count 1 --node-count 1 --keypair <your keypair>

Kubernetes

This will create a kubernetes cluster with one master node, and one minion

$ openstack coe cluster create <clustername> --cluster-template kubernetes-template --master-count 1 --node-count 1 --keypair <your keypair>


Use a cluster

Docker Swarm

TBA

Kubernetes

You can interact with your kubernetes cluster with kubectl. Install it first, if you don't already have it. FINN EN LINK HER KANSKJE

Source your cluster config:

$ mkdir -p ~/clusters/kubernetes-cluster
$ $(openstack coe cluster config kubernetes-cluster --dir ~/clusters/kubernetes-cluster)

That should just work, and you can run kubectl commands as you please.


Our public kubernetes template has a keystone auth module enabled by default. That makes it possible to interact with your newly created cluster via the environment variables from your opencrc file. If you want that, configure kubectl to use openstack auth as follows:

$ kubectl config set-credentials openstackuser --auth-provider=openstack
$ kubectl config set-context --cluster=<yourclustername> --user=openstackuser openstackuser@<yourclustername>
$ kubectl config use-context openstackuser@<yourclustername>
  • No labels