Solum/配置
Solum 支持以下部署配置:
- 使用 nova-docker 部署应用程序容器(我们称之为“部署单元”或 DU),采用 deploy-direct-container 配置
- 在虚拟机 (VM) 上部署应用程序容器 (DU),采用 deploy-container-on-vm 配置
以下描述了每种配置的工作原理。
使用 nova-docker 部署 DU
这种配置的特点在于三点。首先,需要将 nova 配置为使用 nova-docker 计算驱动。这可以通过将以下行添加到 /etc/nova/nova.conf 来完成:compute_driver = novadocker.virt.docker.driver.DockerDriver
其次,DU 镜像需要存储在 Glance 中,以便 nova-docker 驱动程序可以部署它。在 Solum 中,有一个配置参数可以设置,这将导致 DU 镜像存储在 Glance 中。这可以通过将 /etc/solum/solum.conf 中的 image_storage 属性设置为 'glance' 来完成。
第三,Solum 内部使用 'basic' heat 模板执行部署,该模板位于:https://github.com/openstack/solum/blob/master/etc/solum/templates/basic.yaml
在 VM 上部署 DU
从高层来看,这种配置首先启动一个 VM,然后在 VM 上运行 DU 镜像。Solum 通过以下方式实现这一点:
- storing the DU image in Swift - generating a Swift tempURL for the DU - passing instructions as part of the cloud-init section for the Heat template for deploying a VM to download the DU image from Swift, load it, and run it. Internally Solum performs the deployment using the 'coreos' heat template for deployment, which is available at: https://github.com/openstack/solum/blob/master/etc/solum/templates/coreos.yaml Following script lists the steps that get executed upon cloud-init https://github.com/openstack/solum/blob/master/contrib/common/robust-du-handling.sh
为了使之工作,需要以下设置:
在 nova 的 /etc/nova/nova.conf 中,将 compute_driver 值设置为 'libvirt.LibvirtDriver'。
通过各自的 screen 会话重启 nova 服务。Nova 服务名称以 'n-' 开头。可以通过关闭它们 (Cntrl-C) 并启动它们(从 screen 会话中加载之前的命令并执行)来重启这些 nova 服务。
在 solum 的 /etc/solum/solum.conf 中设置以下配置变量
- image_storage value to 'swift' - image_format value to 'vm' - add a variable 'image' and set its value to the id of the VM image (from Glance) that you want to use to spin up the VM. This VM image needs to have Docker installed on it. One option is to use a Coreos image (check: https://coreos.com/os/docs/latest/booting-on-openstack.html) You need to upload the Coreos image to glance as outlined in https://coreos.com/os/docs/latest/booting-on-openstack.html. Then specify the name that you used in uploading the image to Glance as the value of the 'image' variable. - add a variable 'flavor' and set its value to the flavor of the VM. You can set this value to '3' which corresponds to m1.medium flavor.
通过各自的 screen 会话重启 solum 服务。Solum 服务名称以 'solum-' 开头