OpenStack Kolla-Ansible部署Zun容器服务,Zun对接Ceph存储Proxmox

书接上回 OpenStack Kolla-Ansible部署Designate域名解析服务DNS服务DNSaas

本章我们继续来完成OpenStack示例配置组件之Container Optimized中的Zun容器服务。OpenStack Kolla-Ansible部署Zun容器服务。

Zun 是一种 OpenStack 容器服务。它旨在提供一个 OpenStack API,用于在 OpenStack 上配置和管理容器化工作负载。


1. 设置kolla

在部署机,找到 /etc/kolla/globals.yml 

enable_zun: "yes"
enable_kuryr: "yes"
enable_etcd: "yes"
docker_configure_for_zun: "yes"
containerd_configure_for_zun: "yes"

另外再添加一行

zun_configure_for_cinder_ceph: "yes"

1.1 复制ceph文件

需要cinder先对接ceph

mkdir -p /etc/kolla/config/zun/zun-compute
ln -s /etc/kolla/config/cinder/ceph.conf /etc/kolla/config/zun/zun-compute/ceph.conf
ln -s  /etc/kolla/config/cinder/ceph.client.cinder.keyring /etc/kolla/config/zun/zun-compute/ceph.client.cinder.keyring

 

2. 重新引导

kolla-ansible -i ./multinode bootstrap-servers

2.1 常见问题 

2.1.1 找不到ceph软件包

报错如下

The repository 'https://mirror.nju.edu.cn/ceph/debian-pacific jammy Release' does not have a Release file

TASK [openstack.kolla.baremetal : Enable ceph apt repository] ************************************************************************************************************************************************************************
task path: /root/.ansible/collections/ansible_collections/openstack/kolla/roles/baremetal/tasks/configure-ceph-for-zun.yml:12
Using module file /path/to/venv/lib/python3.10/site-packages/ansible/modules/apt_repository.py
Pipelining is enabled.
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'python && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "codename": null,
            "filename": "ceph",
            "install_python_apt": true,
            "mode": null,
            "repo": "deb https://mirror.nju.edu.cn/ceph/debian-pacific/ jammy main",
            "state": "present",
            "update_cache": true,
            "update_cache_retries": 5,
            "update_cache_retry_max_delay": 12,
            "validate_certs": true
        }
    },
    "msg": "Failed to update apt cache: E:The repository 'https://mirror.nju.edu.cn/ceph/debian-pacific jammy Release' does not have a Release file., W:Updating from such a repository can't be done securely, and is therefore disabled by default., W:See apt-secure(8) manpage for repository creation and user configuration details., W:https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details."
}

原因:ceph官方仓库没有jammy版本的软件包,但是Ubuntu官方有ceph-common这个软件包

(venv) root@ubuntu:~# apt search ceph-common
Sorting... Done
Full Text Search... Done
ceph-common/jammy-updates 17.2.0-0ubuntu0.22.04.2 amd64
  common utilities to mount and interact with a ceph storage cluster

python3-ceph-common/jammy-updates 17.2.0-0ubuntu0.22.04.2 all
  Python 3 utility libraries for Ceph

解决,关闭zun自动配置ceph,

zun_configure_for_cinder_ceph = "no"

 手动安装ceph-common软件包

apt install ceph-common -y

3. 重新部署

kolla-ansible -i ./multinode deploy

4. 生成凭据文件

kolla-ansible -i ./multinode post-deploy

5. 安装zun cli客户端

pip install python-zunclient

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Kolla-ansible是一个用于部署OpenStackAnsible playbook集合。要使用kolla-ansible部署Ceph,您需要在控制节点上安装kolla-ansibleceph-ansible。以下是部署Ceph的基本步骤: 1. 在控制节点上安装kolla-ansibleceph-ansible: ``` sudo apt-get install python3-dev libffi-dev gcc libssl-dev python3-venv sudo apt-get install python3-pip sudo pip3 install -U pip sudo pip3 install kolla-ansible sudo git clone https://github.com/ceph/ceph-ansible.git /usr/share/ceph-ansible ``` 2. 准备kolla-ansible部署环境: ``` sudo mkdir -p /etc/kolla sudo chown $USER:$USER /etc/kolla cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/* /etc/kolla cp /usr/local/share/kolla-ansible/ansible/inventory/* . ``` 3. 配置kolla-ansible: 编辑/etc/kolla/globals.yml文件,设置以下内容: ``` kolla_base_distro: "ubuntu" kolla_install_type: "source" openstack_release: "rocky" network_interface: "eth0" neutron_plugin_agent: "openvswitch" ceph_backend: "bluestore" ceph_osd_pool_default_size: "2" ceph_osd_pool_default_pg_num: "128" ``` 4. 配置ceph-ansible: 编辑/etc/kolla/globals.yml文件,设置以下内容: ``` [mons] mon1 mon2 mon3 [osds] osd1 osd2 osd3 [mdss] mds1 mds2 ``` 5. 生成kolla-ansible部署文件: ``` kolla-genpwd kolla-ansible -i ./all-in-one bootstrap-servers kolla-ansible -i ./all-in-one prechecks kolla-ansible -i ./all-in-one deploy ``` 6. 部署完成后,您可以使用以下命令测试Ceph集群: ``` sudo docker ps sudo ceph health ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值