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
The 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.
- 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.
- 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: http://docs.openstack.org/developer/magnum/install-guide-from-source.html
- 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/”.
- Once Magnum’s running, you should be able to send commands to it using the Magnum Client.
- On the command line, you can see how your cluster’s getting on:
- Using Horizon on your DevStack, you should be able to navigate to the “Orchestration” section and see your cluster come to life!
You can interact with your clusters and cluster templates via Horizon using this Horizon plugin: https://github.com/openstack/magnum-ui. Just follow the instructions in the README file.
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: http://docs.openstack.org/developer/magnum/