openstack | kolla-ansible 테스트

이전에 테스트해보고 정리했던 자료인데…빠진 내용이 있을 수 있음.
베어메탈이나 가상머신에서 Kolla Ansible을 이용하여 테스트삼아 오픈스택을 배포하는 내용.

사전 준비

https://docs.openstack.org/project-deploy-guide/kolla-ansible/wallaby/quickstart.html

운영체제

Ubuntu 20.04 LTS 사용

# 지원가능 운영체제정보
CentOS Stream 8
Debian Bullseye(11)
Ubuntu Focal (20.04)
rhel(deprecated)
# https://docs.openstack.org/kolla-ansible/wallaby/user/support-matrix

사전 필요 지식

Ansible
Docker
※ 컨테이너 이미지 : Host OS와 맞추어 주는 것이 좋음.

시스템 최소 요구 사양

2개의 네트워크 인터페이스
8GB 메모리
40GB 디스크 공간

배포과정

Kolla-ansible 배포 환경 구성

Update the Package Index.
Python build 의존성 파일 설치.

sudo apt update && sudo apt install git python3-dev libffi-dev gcc libssl-dev

pip 설치 및 pip 최신버전 설치 확인

sudo apt install python3-pip
sudo pip3 install -U pip

Ansible 설치

sudo apt install ansible

Kolla-ansible 설치

sudo pip3 install git+https://opendev.org/openstack/kolla-ansible@stable/wallaby

오픈스택 구성 환경파일 복사

sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/* /etc/kolla

Ansible inventory 파일 복사

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

Ansible 환경설정

파일 경로편집

vi /etc/ansible/ansible.cfg
[defaults]
host_key_checking=False
pipelining=True
forks=100

host_key_checking : known host 확인 기능
pipelining : 기능을 사용하려면 관리호스트의 /etc/sudoers 파일에서 Defaults requiretty 비활성 해야함.
forks : 최대 연결수

https://docs.ansible.com/ansible/latest/reference_appendices/config.html

Ansible Inventory 설정

# [그룹명]항목# 그룹을 묶는방법[그룹명:다른 그룹명]다른그룹명
[control]
10.0.0.[10:12] ansible_user=ubuntu ansible_password=foobar ansible_become=true
# Ansible supports syntax like [10:12] - that means 10, 11 and 12.
# Become clause means "use sudo".

[network:children]
control
# when you specify group_name:children, it will use contents of group specified.

[compute]
10.0.0.[13:14] ansible_user=ubuntu ansible_password=foobar ansible_become=true

[monitoring]
10.0.0.10
# This group is for monitoring node.
# Fill it with one of the controllers' IP address or some others.

[storage:children]
compute

[deployment]
localhost ansible_connection=local become=true
# use localhost and sudo