Nova Docker driver
Cloud computing has evolved too fast over the last years, currently is a totally different thing as the 5 years ago cloud, today is a common thing listening words like containers, instances, microservices, queue messages on linkedin, twitter, etc.
OpenStack is not a lazy community, new capabilities are daily added to the OpenStack catalog reaching more users and business needs who are discovered at the several summits and meetups over the world. One of that needs is the capability to easy create and manage docker containers.
Now we have two main methods, directly launching instances as containers from nova driver or with heat/kubernetes/messos.
The second method is the one with more followers, but there are some projects which are using nova driver as Solum, for this reason I'm going to show you how to configure docker as nova driver.
The fist step is install docker on the compute nodes
curl -sSL https://get.docker.com/ | sh
+ sh -c 'sleep 3; yum -y -q install docker-engine'
advertencia:/var/cache/yum/x86_64/7/docker-main-repo/packages/docker-engine-selinux-1.9.1-1.el7.centos.noarch.rpm: EncabezadoV4 RSA/SHA512 Signature, ID de clave 2c52609d: NOKEY
No se ha instalado la llave pública de docker-engine-selinux-1.9.1-1.el7.centos.noarch.rpm
Importando llave GPG 0x2C52609D:
Usuarioid : "Docker Release Tool (releasedocker) <[email protected]>"
Huella : 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d
Desde : https://yum.dockerproject.org/gpg
Full path required for exclude: net:[4026532228].
Full path required for exclude: net:[4026532228].
Full path required for exclude: net:[4026532285].
Full path required for exclude: net:[4026532285].
Full path required for exclude: net:[4026532228].
Full path required for exclude: net:[4026532228].
Full path required for exclude: net:[4026532285].
Full path required for exclude: net:[4026532285].Add nova user to docker group, docker group will be created during docker installation
Start docker service
Test docker installation with the following command, a Hello from Docker message should be prompted
Once docker runs in a proper way, enable docker service at boot
Give docker socket the apropiate permissions
Restart nova-compute service
Install git and pip if not present on the system
Clone docker driver for nova from OpenStack repositories
Install basic requirements
Install docker driver
Edit nova.conf and allow docker driver as compute driver
Create the following directory
Create a file with the following content to allow setting networking in docker containers
Edit glance-api.conf and allow docker as container format
Restart glance-api to apply changes
Pull a docker image, i use hipache as testing image
Upload the image to glance
Once the image is active at glance, create a new instance, the instance won\'t be a KVM virtual machine, now will be a docker container
After a while, the instance should be in ACTIVE state
If all the steps worked fine, you can use docker as nova backend.
Regards
Last updated
Was this helpful?