Ubuntu 20.04
Sponsored Link

OpenStack Wallaby : Octavia 設定 (Network ノード)2021/04/21

 
OpenStack Load Balancing as a Service(Octavia)をインストールします。
当例では以下のような環境を例に Octavia をインストールします。
------------+---------------------------+---------------------------+------------
            |                           |                           |
        eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
+-----------+-----------+   +-----------+-----------+   +-----------+-----------+
|    [ Control Node ]   |   |    [ Storage Node ]   |   |    [ Compute Node ]   |
|                       |   |                       |   |                       |
|  MariaDB    RabbitMQ  |   |      Open vSwitch     |   |        Libvirt        |
|  Memcached  httpd     |   |     Neutron Server    |   |     Nova Compute      |
|  Keystone   Glance    |   |       OVN-Northd      |   |      Open vSwitch     |
|  Nova API             |   |     Cinder Volume     |   |   OVN Metadata Agent  |
|  Cinder API           |   |    Octavia Services   |   |     OVN-Controller    |
+-----------------------+   +-----------------------+   +-----------------------+

[1] Octavia サービスをインストールします。インストール中の問いには全て [No] で OK です。
root@network:~#
apt -y install octavia-api octavia-health-manager octavia-housekeeping octavia-worker python3-ovn-octavia-provider
[2] ロードバランサーインスタンスで使用する証明書を作成しておきます。
root@network:~#
mkdir -p /etc/octavia/certs/private

root@network:~#
mkdir ~/work

root@network:~#
cd ~/work

root@network:~/work#
git clone https://opendev.org/openstack/octavia.git

root@network:~/work#
cd octavia/bin

root@network:~/work/octavia/bin#
./create_dual_intermediate_CA.sh

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/server_ca.cert.pem /etc/octavia/certs

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/server_ca-chain.cert.pem /etc/octavia/certs

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/server_ca.key.pem /etc/octavia/certs/private

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/client_ca.cert.pem /etc/octavia/certs

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/client.cert-and-key.pem /etc/octavia/certs/private

root@network:~/work/octavia/bin#
chown -R octavia /etc/octavia/certs

[3] Octavia の設定です。
root@network:~#
mv /etc/octavia/octavia.conf /etc/octavia/octavia.conf.org

root@network:~#
vi /etc/octavia/octavia.conf
# 新規作成

[DEFAULT]
# RabbitMQ 接続情報
transport_url = rabbit://openstack:password@10.0.0.30

[api_settings]
# リスンする IP アドレス
bind_host = 10.0.0.50
bind_port = 9876
auth_strategy = keystone
api_base_uri = http://10.0.0.50:9876

# MariaDB 接続情報
[database]
connection = mysql+pymysql://octavia:password@10.0.0.30/octavia

[health_manager]
bind_ip = 0.0.0.0
bind_port = 5555

# Keystone 接続情報
[keystone_authtoken]
www_authenticate_uri = http://10.0.0.30:5000
auth_url = http://10.0.0.30:5000
memcached_servers = 10.0.0.30:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = octavia
password = servicepassword

# [2] で作成した証明書を指定
[certificates]
ca_private_key = /etc/octavia/certs/private/server_ca.key.pem
ca_certificate = /etc/octavia/certs/server_ca.cert.pem
server_certs_key_passphrase = insecure-key-do-not-use-this-key
ca_private_key_passphrase = not-secure-passphrase

# [2] で作成した証明書を指定
[haproxy_amphora]
server_ca = /etc/octavia/certs/server_ca-chain.cert.pem
client_cert = /etc/octavia/certs/private/client.cert-and-key.pem

# [2] で作成した証明書を指定
[controller_worker]
client_ca = /etc/octavia/certs/client_ca.cert.pem

[oslo_messaging]
topic = octavia_prov

# Keystone 接続情報
[service_auth]
auth_url = http://10.0.0.30:5000
memcached_servers = 10.0.0.30:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = octavia
password = servicepassword

root@network:~#
vi /etc/octavia/policy.yaml
# 新規作成

"context_is_admin": "role:admin or role:load-balancer_admin"
"admin_or_owner": "is_admin:True or project_id:%(project_id)s"
"load-balancer:read": "rule:admin_or_owner"
"load-balancer:read-global": "is_admin:True"
"load-balancer:write": "rule:admin_or_owner"
"load-balancer:read-quota": "rule:admin_or_owner"
"load-balancer:read-quota-global": "is_admin:True"
"load-balancer:write-quota": "is_admin:True"

root@network:~#
chmod 640 /etc/octavia/octavia.conf /etc/octavia/policy.yaml

root@network:~#
chgrp octavia /etc/octavia/octavia.conf /etc/octavia/policy.yaml
root@network:~#
su -s /bin/bash octavia -c "octavia-db-manage --config-file /etc/octavia/octavia.conf upgrade head"

root@network:~#
systemctl restart octavia-api octavia-health-manager octavia-housekeeping octavia-worker

関連コンテンツ