openstack|kolla-ansible部署openstack+ceph高可用集群queens版本---docker私有镜像仓库配置

本文在monitor主机初始化基础上配置
一、安装配置ansible 1、 先使用pip安装再使用yum安装,可以防止某些py包版本太低

[root@kolla ~]# pip install ansible [root@kolla ~]# yum install ansible -y

二、安装配置kolla-ansible: kolla-ansible和openstack的版本需要对应起来,这很重要!
1、Kolla-ansible 版本查看 kolla-ansible项目 git仓库地址
重申Kolla-ansible openstack 版本对应关系
opentstack版本 Kola-ansible版本
Train 9.x.x
Stein 8.x.x
Rocky 7.x.x
queens 6.x.x
Pike 5.x.x
Ocata 4.x.x
2、使用pip安装kolla-ansible:
pip install kolla-ansible==6.x.x--ignore-installed PyYAML

配置kolla-ansible:
1)拷贝globals.yml 和passwords.yml 到 /etc/kolla 目录:
# cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/

2)拷贝kolla-ansible的主机清单文件(all-in-one和multinode)到当前操作目录:
cp /usr/share/kolla-ansible/ansible/inventory/*./

3、使用kolla pull docker镜像 修改global.yml文件
如global-pull1.txt 注:根据实际情况更改信息
[root@monitor ~]# grep -v "^#" ./globals.yml --- kolla_base_distro: "centos" kolla_install_type: "source" openstack_release: "queens" kolla_internal_vip_address: "172.29.55.239"network_interface: "enp7s0f1" enable_aodh: "yes" enable_barbican: "yes" enable_blazar: "yes" enable_ceilometer: "yes" enable_central_logging: "yes" enable_ceph: "yes" enable_ceph_mds: "yes" enable_ceph_rgw: "yes" enable_ceph_nfs: "yes" enable_chrony: "yes" enable_cinder: "yes" enable_cinder_backup: "yes" enable_cinder_backend_hnas_iscsi: "yes" enable_cinder_backend_hnas_nfs: "yes" enable_cinder_backend_iscsi: "yes" enable_cinder_backend_lvm: "yes" enable_cinder_backend_nfs: "yes" enable_cloudkitty: "yes" enable_collectd: "yes" enable_congress: "yes" enable_designate: "yes" enable_destroy_images: "yes" enable_etcd: "yes" enable_fluentd: "yes" enable_freezer: "yes" enable_gnocchi: "yes" enable_grafana: "yes" enable_haproxy: "yes" enable_heat: "yes" enable_horizon: "yes" enable_horizon_cloudkitty: "{{ enable_cloudkitty | bool }}" enable_horizon_designate: "{{ enable_designate | bool }}" enable_horizon_freezer: "{{ enable_freezer | bool }}" enable_horizon_ironic: "{{ enable_ironic | bool }}" enable_horizon_karbor: "{{ enable_karbor | bool }}" enable_horizon_magnum: "{{ enable_magnum | bool }}" enable_horizon_manila: "{{ enable_manila | bool }}" enable_horizon_mistral: "{{ enable_mistral | bool }}" enable_horizon_murano: "{{ enable_murano | bool }}" enable_horizon_neutron_lbaas: "{{ enable_neutron_lbaas | bool }}" enable_horizon_sahara: "{{ enable_sahara | bool }}" enable_horizon_searchlight: "{{ enable_searchlight | bool }}" enable_horizon_senlin: "{{ enable_senlin | bool }}" enable_horizon_solum: "{{ enable_solum | bool }}" enable_horizon_tacker: "{{ enable_tacker | bool }}" enable_horizon_trove: "{{ enable_trove | bool }}" enable_horizon_watcher: "{{ enable_watcher | bool }}" enable_horizon_zun: "{{ enable_zun | bool }}" enable_hyperv: "yes" enable_influxdb: "yes" enable_ironic: "yes" enable_ironic_pxe_uefi: "yes" enable_karbor: "yes" enable_kuryr: "yes" enable_magnum: "yes" enable_manila: "yes" enable_manila_backend_generic: "yes" enable_manila_backend_hnas: "yes" enable_manila_backend_cephfs_native: "yes" enable_manila_backend_cephfs_nfs: "yes" enable_mistral: "yes" enable_mongodb: "yes" enable_murano: "yes" enable_multipathd: "yes" enable_neutron_bgp_dragent: "yes" enable_neutron_dvr: "yes" enable_neutron_lbaas: "yes" enable_neutron_fwaas: "yes" enable_neutron_qos: "yes" enable_neutron_agent_ha: "yes" enable_neutron_aas: "yes" enable_neutron_sriov: "yes" enable_neutron_sfc: "yes" enable_nova_fake: "yes" enable_nova_serialconsole_proxy: "yes" enable_octavia: "yes" enable_opendaylight: "yes" enable_openvswitch: "{{ neutron_plugin_agent != 'linuxbridge' }}" enable_ovs_dpdk: "no" enable_osprofiler: "yes" enable_panko: "yes" enable_qdrouterd: "yes" enable_rally: "yes" enable_redis: "yes" enable_sahara: "yes" enable_searchlight: "yes" enable_senlin: "yes" enable_skydive: "yes" enable_solum: "yes" enable_swift: "yes" enable_telegraf: "yes" enable_tacker: "yes" enable_tempest: "yes" enable_trove: "yes" enable_vitrage: "yes" enable_vmtp: "yes" enable_watcher: "yes" enable_zun: "yes"tempest_image_id: tempest_flavor_ref_id: tempest_public_network_id: tempest_floating_network_name:

拉取镜像
kolla-ansible –i all-in-one pull -vvv
注:也可根据实际情况更改信息拉取镜像
3、启动registry容器,并将端口映射到4000端口 注:这一步在镜像仓库monitor(1172.29.55.229)上配置,最好是选择单独主机作为镜像仓库)
mkdir -p /opt/docker/registry docker run -d -p 4000:5000 -v /opt/docker/registry:/var/lib/registry --restart=always --name registry registry:latest

4、 修改上面拉取到的kolla镜像tag,将kolla镜像上传到上面的私有仓库
修改镜像tag:
for i in `docker images|grep -v registry|grep -v R|awk '{print $1}'`; do docker image tag $i:queens 172.29.55.229:4000/$i:queens; done for i in `docker images|grep kolla|awk '{print $1}'`; do docker tag $i:queens 172.29.55.229:4000/$i:queens; done

#对应移除tag命令:
docker rmi -f $(docker images|grep 172.16.50.31|awk '{print $1":queens"}')

push到本地库:
for i in `docker images|grep kolla:4000|awk '{print $1}'`; do docker push $i:queens; done for i in `docker images|grep 172.29.55.229|awk '{print $1}'`; do docker push $i:queens; done

5、测试Registry服务是否正常(这一步为制作本地私有仓库后再测试)
# curl -X GET http://172.16.50.31:4000/v2/_catalog

【openstack|kolla-ansible部署openstack+ceph高可用集群queens版本---docker私有镜像仓库配置】正常如下返回数据即可:
{"repositories":["kolla/centos-source-aodh-api","kolla/centos-source-aodh-base","kolla/centos-source-aodh-evalua……}

    推荐阅读