kolla all-in-one 安装
http://docs.openstack.org/developer/kolla/
使用了Docker containers and Ansible playbooks
目前在Fedora/Ubuntu/CentOS上测试过
deployment host 需要Ansible>=1.8.4
deployment target 需要docker>=1.7.0 and docker-py>=1.2.0
curl -sSL https://get.docker.io | bash
git clone https://git.openstack.org/openstack/kolla
cd kolla
sudo pip install -r requirements.txt
如果ansible版本太老可以:
pip install -U ansible
配置kolla的ansible
http://docs.openstack.org/developer/kolla/ansible-deployment.html
inventory 文件必须包含所有安装targets
在deployment host上,拷贝etc/kolla 到 /etc/kolla
kolla_external_address: "openstack.example.com"
kolla_internal_address: "10.10.10.254"
kolla_external_address和kolla_internal_address可以相同,
network_interface: "eth0"
服务绑定接口,
neutron_external_interface: "eth1"
连接neutron的external bridge,
如果机器只有一个接口,可以可以创建一个bridge和veth,把veth的一端作为这里的接口,另一端和eth0接到该bridge上。
docker_pull_policy: "always"
是否从指定的repository拉去image,
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 845c7e4..bcd6680 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -18,7 +18,7 @@ node_config_directory: "/etc/kolla"
config_strategy: "COPY_ONCE"
# Valid options are [ centos, fedora, oraclelinux, ubuntu ]
-kolla_base_distro: "centos"
+kolla_base_distro: "ubuntu"
# Valid options are [ binary, source ]
kolla_install_type: "binary"
@@ -107,7 +107,7 @@ ironic_api_port: "6385"
####################
# Openstack options
####################
-openstack_release: "latest"
+openstack_release: "kilo"
openstack_logging_verbose: "True"
openstack_logging_debug: "False"
@@ -142,7 +142,7 @@ enable_rabbitmq: "yes"
# Additional optional OpenStack services are specified here
enable_ceph: "no"
-enable_cinder: "no"
+enable_cinder: "yes"
enable_heat: "yes"
enable_horizon: "yes"
enable_swift: "no"
diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml
index 57b9e27..0d68fb0 100644
--- a/etc/kolla/globals.yml
+++ b/etc/kolla/globals.yml
@@ -68,19 +68,19 @@ network_interface: "eth0"
neutron_external_interface: "eth1"
# Valid options are [ openvswitch, linuxbridge ]
-#neutron_plugin_agent: "openvswitch"
+neutron_plugin_agent: "openvswitch"
####################
# OpenStack options
####################
# This option is used to specify the tag to use when pulling the Docker images
-#openstack_release: "latest"
+openstack_release: "kilo"
# Use these options to set the various log levels across all OpenStack projects
-#openstack_logging_verbose: "True"
+openstack_logging_verbose: "True"
#openstack_logging_debug: "False"
# OpenStack services can be enabled or disabled with these options
-#enable_cinder: "yes"
-#enable_heat: "no"
+enable_cinder: "yes"
+enable_heat: "no"
好啦,如果是all-in-one的部署方式,则所有的containers 都会运行在localhost本机。
cd ./kolla/ansible
ansible-playbook -i inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml site.yml
如果想安装某个特定的服务,可以用Ansible tags
cd ./kolla/ansible
ansible-playbook -i inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml site.yml --tags rabbitmq
ansible-playbook -i inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml site.yml --tags rabbitmq,mariadb
https://registry.hub.docker.com/repos/kollaglue
对每个tagged release都有build的image
- Ceilometer
- Cinder
- Glance
- Haproxy
- Heat
- Horizon
- Keepalived
- Keystone
- Mariadb + galera
- Mongodb
- Neutron (linuxbridge or neutron)
- Nova
- Openvswitch
- Rabbitmq
源码
Directories
===========
- ansible - Contains Anible playbooks to deploy Kolla in Docker
containers.
- demos - Contains a few demos to use with Kolla.
- dev/heat - Contains an OpenStack-Heat based development environment.
- dev/vagrant - Contains a vagrant VirtualBox/Libvirt based development
environment.
- doc - Contains documentation.
- etc - Contains a reference etc directory structure which requires
configuration of a small number of configuration variables to achieve
a working All-in-One (AIO) deployment.
- docker - Contains jinja2 templates for the docker build system.
- tools - Contains tools for interacting with Kolla.
- specs - Contains the Kolla communities key arguments about
architectural shifts in the code base.
- tests - Contains functional testing tools.
http://docs.ansible.com/ansible/docker_module.html
http://docs.ansible.com/ansible/docker_image_module.html
ansible role
ansilbe自1.2版本引入的新特性,用于层次性、结构化地组织playbook。roles能够根据层次型结构自动装载变量文件、tasks以及handlers等。要使用roles只需要在playbook中使用include指令即可。简单来讲,roles就是通过分别将变量、文件、任务、模块及处理器放置于单独的目录中,并可以便捷地include它们的一种机制。角色一般用于基于主机构建服务的场景中,但也可以是用于构建守护进程等场景中。
#创建role的步骤
(1) 创建以roles命名的目录;
(2) 在roles目录中分别创建以各角色名称命名的目录,如webservers等;
(3) 在每个角色命名的目录中分别创建files、handlers、meta、tasks、templates和vars目录;用不
到的目录可以创建为空目录,也可以不创建;
(4) 在playbook文件中,调用各角色;
#role内各目录中可用的文件
tasks目录:至少应该包含一个名为main.yml的文件,其定义了此角色的任务列表;此文件可以使用in
clude包含其它的位于此目录中的task文件;
files目录:存放由copy或script等模块调用的文件;
templates目录:template模块会自动在此目录中寻找Jinja2模板文件;
handlers目录:此目录中应当包含一个main.yml文件,用于定义此角色用到的各handler;在handler
中使用include包含的其它的handler文件也应该位于此目录中;
vars目录:应当包含一个main.yml文件,用于定义此角色用到的变量;
meta目录:应当包含一个main.yml文件,用于定义此角色的特殊设定及其依赖关系;
default目录:为当前角色设定默认变量时使用此目录;应当包含一个main.yml文件;