openstack组件容器化部署工具。
github:https://github.com/openstack/kolla-ansible
划分:
角色 系统 openstack eth0,管理用网络 eth1,提供者网络
controller ubuntu 22.04 yoga 192.168.209.128 192.168.67.128
compute01 ubuntu 22.04 yoga 192.168.209.129 192.168.67.129
注:eth0,要能访问外网
安装:
1、控制节点
# 修改hostname
hostnamectl set-hostname controller
apt update
# 安装配置ssh服务
apt install vim ssh -y
vim /etc/ssh/sshd_config
# 将 PermitRootLogin 改成 yes
systemtl restart ssh && systemctl enable ssh
# 修改网卡名,让其变成eth*这样格式
vim /etc/default/grub
# 将 GRUB_CMDLINE_LINUX="" 改成 GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
reboot
# 安装配置ansible
apt install sshpass python3-pip python3-dev libffi-dev gcc libssl-dev -y
pip3 install "ansible>=4,<6" -i https://pypi.tuna.tsinghua.edu.cn/simple
# pip方式安装的ansible配置文件及文件所在目录需要手动创建
mkdir -p /etc/ansible
vim /etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100
# 安装配置kolla-ansible
pip3 install kolla-ansible==14.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
# 下方命令会需要系统预先安装git,没有的话注意安装下,apt install git -y
kolla-ansible install-deps
cd ~
cp /usr/local/share/kolla-ansible/ansible/inventory/* ./
# 会看到复制了2个文件 all-in-one 和 multinode
# all-in-one 对应单机版,这里是双节点配置 multinode 文件
vim ./multinode
# 开头添加下方3行,然后修改control、network、compute、monitoring、storage、deployment部分
controller ansible_host=192.168.209.128 ansible_user=root ansible_password=QAlp45cn ansible_python_interpreter=/usr/bin/python3
compute01 ansible_host=192.168.209.129 ansible_user=root ansible_password=QAlp45cn ansible_python_interpreter=/usr/bin/python3
[control]
controller
[network]
controller
compute01
[compute]
compute01
[monitoring]
controller
# [storage]
# storage01
[deployment]
localhost ansible_connection=local become=true
mkdir -p /etc/kolla
cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
# 会看到复制了2个文件 globals.yml 和 passwords.yml
# 生成openstack安装配置过程中需要用到的密码,生成的密码会写入/etc/kolla/passwords.yml文件中
kolla-genpwd
cat << EOF > /etc/kolla/globals.yml
---
kolla_base_distro: "ubuntu"
kolla_install_type: "source" # 使⽤基于源代码的image
openstack_release: "yoga" # 该配置项最好与kolla-ansible分⽀版本保持⼀致
kolla_internal_vip_address: "192.168.209.130" # 找一个eth0网卡网段内没有占用的ip
network_interface: "eth0" # openstack管理用网络,为openstack节点提供internet
neutron_external_interface: "eth1" # openstack提供者网络,为openstack创建的虚拟机提供internet
enable_haproxy: "yes"
nova_compute_virt_type: "qemu"
EOF
2、计算节点
hostnamectl set-hostname compute01
apt update
apt install vim ssh -y
vim /etc/ssh/sshd_config
# 将 PermitRootLogin 改成 yes
systemtl restart ssh && systemctl enable ssh
vim /etc/default/grub
# 将 GRUB_CMDLINE_LINUX="" 改成 GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
reboot
3、开始安装
切换到管理节点上操作。
# 开始安装
# 整个安装部署过程较慢,耐心等待
cd ~
kolla-ansible -i ./multinode bootstrap-servers
kolla-ansible -i ./multinode prechecks
# 拉取镜像,建议配置国内加速
kolla-ansible -i ./multinode pull
kolla-ansible -i ./multinode deploy
# openstack-client安装
pip3 install python-openstackclient -c https://releases.openstack.org/constraints/upper/master
# 生成admin-openrc文件
kolla-ansible post-deploy
. /etc/kolla/admin-openrc.sh
# 查看已经启动的服务
openstack service list
# 获取admin密码
cat /etc/kolla/admin-openrc.sh
# 删除openstack
kolla-ansible -i ./multinode destroy --yes-i-really-really-mean-it
4、访问登录