Magnum CI - Container Infrastructure Like A Pro

Magnum is OpenStack’s container infrastructure service – a unified way into the various container eco systems that leverages existing OpenStack services.

Magnum CI - Container Infrastructure Like A Pro

YOU’d have to have been living under a rock the last few years to have avoided the buzz surrounding containers. Technologies like Docker, Google’s Kubernetes, and Apache’s Mesos have completely rocked the status quo when it comes to automatable infrastructure and application deployment. So how does OpenStack’s Magnum project fit into all this..?

What are containers?

Before we dive into Magnum, let’s remind ourselves of the differences between virtual machines (instances) and containers.

Containers consist of an entire runtime environment: an application, plus all its dependencies, libraries and other binaries, and configuration files needed to run it, bundled into one package. By containerising the application platform and its dependencies, differences in operating systems and underlying infrastructure are abstracted away.

As containers are usually only a few megabytes in size, it’s possible to run lots of them on the same instance in an isolated way.


Automating your container infrastructure

Using Heat to provision Magnum ClustersThe Magnum project abstracts the concept of a container cluster such that you can easily configure and create container infrastructure regardless of your choice of underlying technology. It achieves this by using OpenStack Heat behind the scenes to provision all the necessary plumbing.

In turn, Heat uses Neutron networking, Cinder Volumes, Nova Instances. Magnum also takes advantage of OpenStack’s secrets store project, Barbican, in order to keep things secure. By leveraging all these established OpenStack projects it becomes almost trivial to automate and adjust infrastructure to support containerised apps.

Try Magnum for yourself

DataCentred will be rolling out full production support for Magnum in 2017. In the meantime, you can have a go at running it yourself using DevStack.

Pro Tips: A lot of tutorials recommend standing up Magnum using DevStack with support for Octavia, Barbican and LBaas v2. For basic testing you don’t need any of these dependencies so we recommend leaving them out. Magnum can store certificates locally without Barbican’s help and you only need LBaaS for high availability clusters.

  1. Get yourself a basic vanilla DevStack installed at stable/newton level. Magnum does work on Mitaka but quite a lot has changed regarding naming and the introduction of microversions.
  2. When DevStack has finished starting (20 minutes or so), it’s time to install and configure Magnum. It does take a little while, but we recommend installing from source to get a feel for how the project fits together:
  3. In /etc/magnum/magnum.conf, make sure you set the RabbitMQ password to “password” in the transport_url setting, set cert_manager_type to “local”, and storage_path to “/var/lib/magnum/certificates/”.
  4. Once Magnum’s running, you should be able to send commands to it using the Magnum Client.
  5. On the command line, you can see how your cluster’s getting on:
  6. Using Horizon on your DevStack, you should be able to navigate to the “Orchestration” section and see your cluster come to life!

Magnum Cluster running Kubernetes

Bonus Points

You can interact with your clusters and cluster templates via Horizon using this Horizon plugin: Just follow the instructions in the README file.

Further Reading

There’s plenty of information out there about using Magnum and running various different container orchestration environments on it. Take a look at the OpenStack documentation here: