Debian 12 bookworm
Sponsored Link

OpenStack Zed : Magnum 設定 (Control ノード)2023/06/30

 
OpenStack Container Infrastructure Management Service(Magnum)をインストールします。
当例では以下のような環境を例に Network ノードに Magnum サービス一式をインストールします。
------------+--------------------------+--------------------------+------------
            |                          |                          |
        eth0|10.0.0.30             eth0|10.0.0.50             eth0|10.0.0.51
+-----------+-----------+  +-----------+-----------+  +-----------+-----------+
|   [ dlp.srv.world ]   |  | [ network.srv.world ] |  |  [ node01.srv.world ] |
|     (Control Node)    |  |     (Network Node)    |  |     (Compute Node)    |
|                       |  |                       |  |                       |
|  MariaDB    RabbitMQ  |  |  Neutron L2/L3 Agent  |  |        Libvirt        |
|  Memcached  Nginx     |  |   Neutron Metadata    |  |      Nova Compute     |
|  Keystone   httpd     |  |     Open vSwitch      |  |    Neutron L2 Agent   |
|  Glance     Nova API  |  |     iSCSI Target      |  |      Open vSwitch     |
|  Neutron Server       |  |     Cinder Volume     |  |                       |
|  Neutron Metadata     |  |    Heat API/Engine    |  |                       |
|  Cinder API           |  |         Nginx         |  |                       |
|  Barbican API         |  |    Magnum Services    |  |                       |
+-----------------------+  +-----------------------+  +-----------------------+

[1] Control ノードの Keystone に Magnum 用のユーザー等々を登録しておきます。
# [service] プロジェクト所属で [magnum] ユーザーを作成

root@dlp ~(keystone)#
openstack user create --domain default --project service --password servicepassword magnum

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | d8b09d86ed7743039f92b2e542ea26c1 |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | c5916ff29c094da88560ba100c6f0340 |
| name                | magnum                           |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# [magnum] ユーザーを [admin] ロール に加える

root@dlp ~(keystone)#
openstack role add --project service --user magnum admin
# [magnum] 用サービスエントリ作成

root@dlp ~(keystone)#
openstack service create --name magnum --description "OpenStack Containers Orchestration" container-infra

+-------------+------------------------------------+
| Field       | Value                              |
+-------------+------------------------------------+
| description | OpenStack Containers Orchestration |
| enabled     | True                               |
| id          | 1b03b42631bf4897ae9b557072c9fa17   |
| name        | magnum                             |
| type        | container-infra                    |
+-------------+------------------------------------+

# Magnum API ホストを定義

root@dlp ~(keystone)#
export magnum_api=network.srv.world
# [magnum] 用エンドポイント作成 (public)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne container-infra public https://$magnum_api:9511/v1

+--------------+-----------------------------------+
| Field        | Value                             |
+--------------+-----------------------------------+
| enabled      | True                              |
| id           | 1fec777537c343d895976144d4e52989  |
| interface    | public                            |
| region       | RegionOne                         |
| region_id    | RegionOne                         |
| service_id   | 1b03b42631bf4897ae9b557072c9fa17  |
| service_name | magnum                            |
| service_type | container-infra                   |
| url          | https://network.srv.world:9511/v1 |
+--------------+-----------------------------------+

# [magnum] 用エンドポイント作成 (internal)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne container-infra internal https://$magnum_api:9511/v1

+--------------+-----------------------------------+
| Field        | Value                             |
+--------------+-----------------------------------+
| enabled      | True                              |
| id           | a7c40a5dfc6b4ec1b8efde2d71adf121  |
| interface    | internal                          |
| region       | RegionOne                         |
| region_id    | RegionOne                         |
| service_id   | 1b03b42631bf4897ae9b557072c9fa17  |
| service_name | magnum                            |
| service_type | container-infra                   |
| url          | https://network.srv.world:9511/v1 |
+--------------+-----------------------------------+

# [magnum] 用エンドポイント作成 (admin)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne container-infra admin https://$magnum_api:9511/v1

+--------------+-----------------------------------+
| Field        | Value                             |
+--------------+-----------------------------------+
| enabled      | True                              |
| id           | bc58559c95554e5591675375a4d6a6d2  |
| interface    | admin                             |
| region       | RegionOne                         |
| region_id    | RegionOne                         |
| service_id   | 1b03b42631bf4897ae9b557072c9fa17  |
| service_name | magnum                            |
| service_type | container-infra                   |
| url          | https://network.srv.world:9511/v1 |
+--------------+-----------------------------------+

# [magnum] ドメイン作成

root@dlp ~(keystone)#
openstack domain create --description "Containers projects and users" magnum

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Containers projects and users    |
| enabled     | True                             |
| id          | e075f971d8174137ae9dcb16ee685daa |
| name        | magnum                           |
| options     | {}                               |
| tags        | []                               |
+-------------+----------------------------------+

# [magnum_domain_admin] ユーザー作成

root@dlp ~(keystone)#
openstack user create --domain magnum --password servicepassword magnum_domain_admin

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | e075f971d8174137ae9dcb16ee685daa |
| enabled             | True                             |
| id                  | 846e638c9f394766bf193e09782e1b4e |
| name                | magnum_domain_admin              |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# [magnum_domain_admin] ユーザーを [admin] ロール に加える

root@dlp ~(keystone)#
openstack role add --domain magnum --user-domain magnum --user magnum_domain_admin admin
[2] Magnum 用のユーザーとデータベースを MariaDB に作成しておきます。
root@dlp ~(keystone)#
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 216
Server version: 10.11.3-MariaDB-1 Debian 12

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database magnum character set utf8mb3 collate utf8mb3_general_ci; 
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on magnum.* to magnum@'localhost' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all privileges on magnum.* to magnum@'%' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit 
Bye
関連コンテンツ