Ubuntu 22.04
Sponsored Link

OpenStack Zed : Configure Magnum (Control Node)
2022/10/11
 
Install OpenStack Container Infrastructure Management Service (Magnum).
This example is based on the environment like follows.
Install Magnum services on Network Node.
------------+-----------------------------+-----------------------------+------------
            |                             |                             |
        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  |     |      Open vSwitch     |     |        Libvirt        |
|  Memcached  Nginx     |     |     Neutron Server    |     |      Nova Compute     |
|  Keystone   httpd     |     |      OVN-Northd       |     |      Open vSwitch     |
|  Glance     Nova API  |     |  Nginx  iSCSI Target  |     |   OVN Metadata Agent  |
|  Cinder API           |     |     Cinder Volume     |     |     OVN-Controller    |
|  Barbican API         |     |    Heat API/Engine    |     |                       |
|                       |     |    Magnum Services    |     |                       |
+-----------------------+     +-----------------------+     +-----------------------+

[1] Add users and others for Magnum in Keystone.
# create [magnum] user in [service] project

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

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

# add [magnum] user in [admin] role

root@dlp ~(keystone)#
openstack role add --project service --user magnum admin
# create service entry for [magnum]

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

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

# define Magnum API Host

root@dlp ~(keystone)#
export magnum_api=network.srv.world
# create endpoint for [magnum] (public)

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

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

# create endpoint for [magnum] (internal)

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

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

# create endpoint for [magnum] (admin)

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

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

# create [magnum] domain

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

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

# create [magnum_domain_admin] user

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

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | df438b18c9b043679a5bb1c0baa6f9de |
| enabled             | True                             |
| id                  | 8726616d293e45b992e976513b25fadd |
| name                | magnum_domain_admin              |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# add [magnum_domain_admin] user to [admin] role

root@dlp ~(keystone)#
openstack role add --domain magnum --user-domain magnum --user magnum_domain_admin admin
[2] Add a User and Database on MariaDB for Magnum.
root@dlp ~(keystone)#
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 109
Server version: 10.6.7-MariaDB-2ubuntu1.1 Ubuntu 22.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
Matched Content