首页 > 代码库 > kolla 容器化openstack

kolla 容器化openstack

目前手动部署openstack都很繁琐 so all of people 都在研究怎么能快速 简单的部署openstack 最近也在研究

在官网看到了 kolla的这东东 经过调研 好多人在用 也就义无反顾的 跟随了 开始kolla的时代

一、系统环境

centos7.2 两块网卡 4c 8G 40G

二、kolla是做openstack容器化的镜像 而kolla-ansible是用来部署openstack插件 由于kolla对组建的版本以来较大 so 你懂得 只列出mitaka和ocata的依赖版本

Dependencies for the stable/mitaka branch are:


Component Min Version Max Version Comment

Ansible 1.9.4        <2.0.0 On deployment host

Docker 1.10.0      none On target nodes

Docker Python 1.6.0  none On target nodes

Python Jinja2 2.6.0   none On deployment host 


Dependencies for the stable/ocata branch are:


Component Min Version Max Version Comment

Ansible  2.0.0      none On deployment host

Docker 1.10.0      none On target nodes

Docker Python 1.8.1  none On target nodes

Python Jinja2 2.8.0  none On deployment host

三、安装依赖环境 使用pip来安装kolla

yum install epel-release

yum install python-pip

pip install -U pip

yum install python-devel libffi-devel gcc openssl-devel libselinux-python


四、在目标主机上安装docker 最新版本的kolla需要引擎docker-engine>=1.10.0,!=1.13.0

curl -sSL https://get.docker.io | bash

创建docker.service drop-in单元 用于部署Neutron-dhcp-agent container否则会失败

mkdir -p /etc/systemd/system/docker.service.d

tee /etc/systemd/system/docker.service.d/kolla.conf <<-‘EOF‘

[Service]

MountFlags=shared

EnvironmentFile=-/etc/sysconfig/docker

#EnvironmentFile=-/etc/sysconfig/docker-storage

#EnvironmentFile=-/etc/sysconfig/docker-network

ExecStart=

ExecStart=/usr/bin/dockerd  daemon -H fd:// --mtu 1400 --insecure-registry 192.168.1.61:4000

#ExecStart=/usr/bin/dockerd $DOCKER_OPTS

EOF

加载后重启docker systemctl daemon-reload && systemctl restart docker

更新docker libraries yum install python-docker-py

五、安装ntp服务 用于时间同步 不多说

六、禁用系统中的libvirt

systemctl stop libvirtd.service

systemctl disable libvirtd.service

七、在管理节点安装kolla

pip install kolla-ansible

八、cp globals.yml和passwords.yml到/etc

cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/kolla/

cp /usr/share/kolla-ansible/ansible/inventory/* /usr/share/kolla-ansible/ansible/

九、安装local registry 

docker run -d -p 4000:5000 --restart=always -v /data/Iaas/Docker/Volumes/Registry:/var/lib/registry --name registry registry:2 

十、/etc/kolla/globals.yml 在Neutron中增加网卡口 如不需要外网 可以不用配置external

kolla_internal_vip_address: "192.168.1.251"

network_interface: "em1"

neutron_external_interface: "em2"

docker_registry: "192.168.1.61:4000"

kolla_install_type: "source"

十一、生成随机密码 在/etc/kolla/passwords.yml

kolla-genpwd

#kolla-ansible -i <<inventory file>> bootstrap-servers

十二、Build container images

先修改docker mtu /etc/systemd/system/docker.service.d/kolla.conf

kolla-ansible pull

docker images

kolla-build --base centos --type source --registry 192.168.1.61:4000 --push

十三、部署kolla

kolla-ansible prechecks -i /usr/share/kolla-ansible/ansible/inventory/all-in-one

kolla-ansible deploy -i /usr/share/kolla-ansible/ansible/inventory/all-in-one

docker ps -a

kolla-ansible post-deploy 生成admin-openrc.sh 在/etc/kolla

十四、初始化网络和镜像

. /etc/kolla/admin-openrc.sh

cd /usr/share/kolla-ansible

./init-runonce


本文出自 “让我men共同成长” 博客,请务必保留此出处http://wujingfeng.blog.51cto.com/5725921/1946790

kolla 容器化openstack