溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

kolla-ansible部署的示例分析

發(fā)布時(shí)間:2021-12-28 16:13:46 來(lái)源:億速云 閱讀:275 作者:柒染 欄目:云計(jì)算

本篇文章為大家展示了kolla-ansible部署的示例分析,內(nèi)容簡(jiǎn)明扼要并且容易理解,絕對(duì)能使你眼前一亮,通過(guò)這篇文章的詳細(xì)介紹希望你能有所收獲。

kolla-ansible部署的大致流程

執(zhí)行命令Kolla-ansible –i multinode deploy后,koll會(huì)調(diào)用ansible-playbook命令,

接著執(zhí)行ansible-playbook -i multinode -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla  -e action=deploy /usr/share/kolla-ansible/ansible/site.yml

然后安裝site.yml里的任務(wù)菜單按順序執(zhí)行

ansible

Library

Kolla_container_facts.py

模塊kolla_container_facts

描述:用于檢查是否有容器正在運(yùn)行

選項(xiàng):
api_version:docker-py的api版本,非必要項(xiàng),str類型,默認(rèn)值是auto
name:容器名字,非必要項(xiàng),str或list類型

調(diào)用例子:
- hosts: all
  tasks:
    - name: Gather docker facts
      kolla_container_facts:

    - name: Gather glance container facts
      kolla_container_facts:
        name:
          - glance_api
          - glance_registry

Kolla_docker.py

模塊:kolla_docker
描述:用于控制Docker的容器
選項(xiàng):
common_options:包含公共參數(shù)的字典選項(xiàng),如登陸信息等,非必要項(xiàng),dict類型,默認(rèn)值為dict()
action:模塊當(dāng)中可供調(diào)用的動(dòng)作方法,必要項(xiàng),str類型,可選擇的action有:compare_container,compare_image,create_volume,get_container_env,get_container_state,pull_iamge,remove_volume,remove_container,recreate_or_restart_container,restart_container,start_container,stop_container
api_version:docker-py的api版本,非必要項(xiàng),str類型, 默認(rèn)值是auto
auth_email:用于認(rèn)證的郵箱地址,非必要項(xiàng),str類型
auth_password:用于認(rèn)證的密碼,非必要項(xiàng),str類型
auth_registry:用于認(rèn)證的registry,非必要項(xiàng),str類型
auth_username:用于認(rèn)證的用戶名,非必要項(xiàng),str類型
detach:在容器創(chuàng)建后進(jìn)行分離,非必要項(xiàng),bool類型, 默認(rèn)值是True
name:要管理的容器或卷的名字,非必要項(xiàng),str類型
environment:在容器里設(shè)置的環(huán)境變量,非必要項(xiàng),dict類型
image:docker鏡像的名字,非必要項(xiàng),str類型
ipc_mode:設(shè)置docker的ipc命名空間,非必要項(xiàng),str類型,默認(rèn)值是None,可選擇的值有:host
cap_add:給容器添加capabilities,非必要項(xiàng),list類型, 默認(rèn)值是list()
security_opt:設(shè)置容器安全配置文件,非必要項(xiàng),list類型, 默認(rèn)值是list()
labels:應(yīng)用于容器的標(biāo)簽列表,非必要項(xiàng),dict類型, 默認(rèn)值是dict ()
pid_mode:設(shè)置docker pid命名空間,非必要項(xiàng),str類型, 默認(rèn)值是None ,可選擇的值有:host
privileged:給容器設(shè)置特權(quán),非必要項(xiàng),bool類型, 默認(rèn)值是False
remove_on_exit:當(dāng)沒(méi)有從容器分離時(shí),在成功退出時(shí)刪除,非必要項(xiàng),bool類型, 默認(rèn)值是True
restart_policy:確定當(dāng)容器退出時(shí)docker應(yīng)做什么,非必要項(xiàng),str類型,可選擇的值有:never,on-failure,always,unless-stopped
restart_retries:當(dāng)restart_policy被設(shè)置時(shí),容器重啟的次數(shù),int類型, 默認(rèn)值是10
volumes:設(shè)置要使用的卷,非必要項(xiàng), list類型
volumes_from:要使用卷的容器的名字或ID,必要項(xiàng) list類型
調(diào)用例子:
- hosts: kolla_docker
  tasks:
    - name: Start container
      kolla_docker:
        image: ubuntu
        name: test_container
        action: start_container
    - name: Remove container
      kolla_docker:
        name: test_container
        action: remove_container
    - name: Pull image without starting container
      kolla_docker:
        action: pull_container
        image: private-registry.example.com:5000/ubuntu
    - name: Create named volume
        action: create_volume
        name: name_of_volume
    - name: Remove named volume
        action: remove_volume
        name: name_of_volume

Kolla_toolbox.py

模塊:kolla_toolbox
描述:被kolla項(xiàng)目用于在kolla_toolbox容器里調(diào)用ansible模塊
可選項(xiàng):
module_name:調(diào)用的模塊名,必要項(xiàng),str類型
module_args:傳遞給被調(diào)用模塊的參數(shù),非必要項(xiàng),str或dict類型
module_extra_vars: 傳遞給被調(diào)用模塊的額外參數(shù),非必要項(xiàng),str或dict類型
調(diào)用例子:
- hosts: controller
  tasks:
    - name: Ensure the direct absent
      kolla_toolbox:
        module_name: file
        module_args: path=/tmp/a state=absent
    - name: Create mysql database
      kolla_toolbox:
        module_name: mysql_db
        module_args:
          login_host: 192.168.1.10
          login_user: root
          login_password: admin
          name: testdb
    - name: Creating default user role
      kolla_toolbox:
        module_name: os_keystone_role
        module_args:
          name: _member_
          auth: "{{ '{{ openstack_keystone_auth }}' }}"
        module_extra_vars:
          openstack_keystone_auth:
            auth_url: http://127.0.0.1:5000
            username: admin
            password: password
            project_name: "admin"
            domain_name: "default"

Site.yml

描述:kolla-ansible部署的入口,kolla調(diào)用ansible執(zhí)行playbook的入口文件

etc

kolla

globals.yml

描述: kolla-ansible部署openstack時(shí)需要進(jìn)行配置的全局變量。此配置文件可以對(duì)kolla項(xiàng)目所用到的變量進(jìn)行重載。此文件所有被注釋掉的參數(shù)的默認(rèn)值可以在kolla-ansible/ansible/group_vars/all.yml找到。

Kolla選項(xiàng)

config_strategy: "COPY_ALWAYS"; 可選項(xiàng)有[ COPY_ONCE, COPY_ALWAYS ]

kolla_base_distro: "centos";可選項(xiàng)有[ centos, oraclelinux, ubuntu ]

kolla_install_type: "source";可選項(xiàng)有[ binary, source ]

openstack_release: "4.0.3";容器鏡像的版本

node_custom_config: "/etc/kolla/config";可以在此目錄下自定義一些配置文件

kolla_internal_vip_address: "192.168.215.209"; 此VIP必須是個(gè)未被使用的IP,它將被用于keepalived進(jìn)行高可用

kolla_internal_fqdn: "{{ kolla_internal_vip_address }}";這是映射到VIP的DNS

kolla_external_vip_address: "{{ kolla_internal_vip_address }}";此VIP必須是個(gè)未被使用的IP,它將被用于keepalived進(jìn)行高可用,默認(rèn)使用kolla_internal_vip_address時(shí),允許內(nèi)部和外部通信共享相同的地址

kolla_external_fqdn: "{{ kolla_external_vip_address }}";用于與要在其中創(chuàng)建的端點(diǎn)的public_url中設(shè)置的OpenStack進(jìn)行通信的公共地址。

Docker選項(xiàng)

docker_registry: "192.168.215.202:4000"; docker鏡像倉(cāng)庫(kù)的地址

docker_namespace: "lokolla";鏡像倉(cāng)庫(kù)的命名空間

docker_registry_username: "sam";鏡像倉(cāng)庫(kù)的賬號(hào)

docker_registry_password: "correcthorsebatterystaple";鏡像倉(cāng)庫(kù)的密碼

Neutron選項(xiàng)

network_interface: "eth0";所有的aip服務(wù)默認(rèn)是使用此網(wǎng)卡進(jìn)行通信。此網(wǎng)卡必須包含一個(gè)IPv4地址

以下這幾個(gè)可以用于特定需求的網(wǎng)卡使用

#kolla_external_vip_interface: "{{ network_interface }}"

#api_interface: "{{ network_interface }}"

#storage_interface: "{{ network_interface }}"

#cluster_interface: "{{ network_interface }}"

#tunnel_interface: "{{ network_interface }}"

#dns_interface: "{{ network_interface }}"

neutron_external_interface: "eth2";這是給neutron作為其外部網(wǎng)絡(luò)端口的原始接口

neutron_plugin_agent: "openvswitch";可選項(xiàng)有[ openvswitch, linuxbridge ]

keepalived選項(xiàng)

keepalived_virtual_router_id: "52";keepalived集群的唯一ID,取值應(yīng)該在0到255之間

TLS選項(xiàng)

要在kolla_external_vip_interface上提供加密和身份驗(yàn)證,可以啟用TLS。啟用TLS時(shí),必須提供證書以允許客戶端執(zhí)行身份驗(yàn)證。

kolla_enable_tls_external: "no"

kolla_external_fqdn_cert: "{{ node_config_directory }}/certificates/haproxy.pem"

OpenStack選項(xiàng)

openstack_logging_debug: "False";可選項(xiàng)有[ True, False ]

nova_console: "novnc";可選項(xiàng)有[ novnc, spice ]

啟動(dòng)或關(guān)掉openstack服務(wù)的選項(xiàng)

#enable_aodh: "no"

#enable_barbican: "no"

#enable_ceilometer: "no"

#enable_central_logging: "no"

#enable_ceph: "no"

#enable_ceph_rgw: "no"

#enable_chrony: "no"

enable_cinder: "yes"

#enable_cinder_backend_hnas_iscsi: "no"

#enable_cinder_backend_hnas_nfs: "no"

#enable_cinder_backend_iscsi: "no"

enable_cinder_backend_lvm: "yes"

#enable_cinder_backend_nfs: "no"

。。。。。。。。。。。

 

Ceph選項(xiàng)

Ceph可以設(shè)置緩存來(lái)提高性能。要使用緩存,您必須提供不同于OSD的磁盤

ceph_enable_cache: "no"

ceph_cache_mode: "writeback";可選項(xiàng)有[ forward, none, writeback ]

ceph_pool_type: "replicated";可選項(xiàng)有[ erasure, replicated ];使用擦除編碼池的要求是必須設(shè)置緩存層

Keystone Identity選項(xiàng)

keystone_token_provider: 'uuid';可選項(xiàng)有[ uuid, fernet ]

fernet_token_expiry: 86400

Glance Image選項(xiàng)

glance_backend_file: "yes"

glance_backend_ceph: "no"

Ceilometer選項(xiàng)

ceilometer_database_type: "mongodb";可選項(xiàng)有[ mongodb, mysql, gnocchi ]

ceilometer_event_type: "mongodb";可選項(xiàng)有[ mongodb, gnocchi, panko ]

Barbican選項(xiàng)

barbican_crypto_plugin: "simple_crypto";可選項(xiàng)有[ simple_crypto, p11_crypto ]

barbican_library_path: "/usr/lib/libCryptoki2_64.so"

Barbican選項(xiàng)

panko_database_type: "mysql";可選項(xiàng)有[ mongodb, mysql ]

Gnocchi選項(xiàng)

gnocchi_backend_storage: "{{ 'ceph' if enable_ceph|bool else 'file' }}";可選項(xiàng)有[ file, ceph ]

Cinder - Block Storage選項(xiàng)

#cinder_backend_ceph: "{{ enable_ceph }}"

cinder_volume_group: "cinder-volumes"

#cinder_backup_driver: "nfs"

#cinder_backup_share: ""

#cinder_backup_mount_options_nfs: ""

Designate選項(xiàng)

designate_backend: "bind9"

designate_ns_record: "sample.openstack.org"

Nova - Compute選項(xiàng)

#nova_backend_ceph: "{{ enable_ceph }}"

Horizon - Dashboard選項(xiàng)

#horizon_backend_database: "{{ enable_murano | bool }}"

Manila - Shared File System選項(xiàng)

# HNAS backend configuration

#hnas_ip:

#hnas_user:

#hnas_password:

#hnas_evs_id:

#hnas_evs_ip:

#hnas_file_system_name:

Swift - Object Storage選項(xiàng)

Swift希望可以使用塊設(shè)備進(jìn)行存儲(chǔ)。支持兩種類型的存儲(chǔ):1-具有特殊分區(qū)名稱和文件系統(tǒng)標(biāo)簽的存儲(chǔ)設(shè)備;2-具有文件系統(tǒng)的未分區(qū)磁盤。該文件系統(tǒng)的標(biāo)簽用于檢測(cè)Swift將要使用的磁盤。

#swift_devices_match_mode: "strict";可選項(xiàng)有[ prefix, strict ]

#swift_devices_name: "KOLLA_SWIFT_DATA";此參數(shù)定義匹配模式:如果選擇了“strict”模式,對(duì)于swift_devices_match_mode,swift_device_name應(yīng)指定特殊swift分區(qū)的名稱,例如:“KOLLA_SWIFT_DATA”,如果選擇“前綴”模式,則swift_devices_name應(yīng)指定匹配的模式 到文件系統(tǒng)的標(biāo)簽為快速準(zhǔn)備

Tempest選項(xiàng)(openstack集成測(cè)試套件)

tempest_image_id:

tempest_flavor_ref_id:

tempest_public_network_id:

tempest_floating_network_name:

# tempest_image_alt_id: "{{ tempest_image_id }}"

# tempest_flavor_ref_alt_id: "{{ tempest_flavor_ref_id }}"

上述內(nèi)容就是kolla-ansible部署的示例分析,你們學(xué)到知識(shí)或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識(shí)儲(chǔ)備,歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI