Ubuntu 20.04
Sponsored Link

OpenStack Victoria : Magnum 設定 (Control ノード)2020/10/24

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

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

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

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | 37197271a1954ddb90207a95d5f46488 |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 08052d6e306c4ec7986996e31df01729 |
| 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          | b13d310cd9454c28b00180582dbe186e   |
| name        | magnum                             |
| type        | container-infra                    |
+-------------+------------------------------------+

# Magnum API ホストを定義

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

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

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | fb43b0b8a75d4b0a9b20c73fc16afd22 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | b13d310cd9454c28b00180582dbe186e |
| service_name | magnum                           |
| service_type | container-infra                  |
| url          | http://10.0.0.50:9511/v1         |
+--------------+----------------------------------+

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

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

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 08dcf3bd46fc4b3cb85acdaf5d14ffdb |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | b13d310cd9454c28b00180582dbe186e |
| service_name | magnum                           |
| service_type | container-infra                  |
| url          | http://10.0.0.50:9511/v1         |
+--------------+----------------------------------+

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

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

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 4f5b3766f8504e5f943021893d149999 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | b13d310cd9454c28b00180582dbe186e |
| service_name | magnum                           |
| service_type | container-infra                  |
| url          | http://10.0.0.50: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          | 43fa6b79e5e24b6290184418c49d3fd5 |
| name        | magnum                           |
| options     | {}                               |
| tags        | []                               |
+-------------+----------------------------------+

# [magnum_domain_admin] ユーザー作成

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

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | 43fa6b79e5e24b6290184418c49d3fd5 |
| enabled             | True                             |
| id                  | c9bf3b2582274d47ba6629e157e9cc0b |
| 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 3188
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04

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; 
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
関連コンテンツ