Docker Install Ubuntu¶
This section describes how to install and configure the Skyline APIServer
service. Before you begin, you must have a ready OpenStack environment. At
least it includes keystone, glance, nova and neutron service
.
Note
You have install the docker service on the host machine. You can follow the docker installation.
Prerequisites¶
Before you install and configure the Skyline APIServer service, you must create a database.
To create the database, complete these steps:
Use the database access client to connect to the database server as the
root
user:# mysql
Create the
skyline
database:MariaDB [(none)]> CREATE DATABASE skyline DEFAULT CHARACTER SET \ utf8 DEFAULT COLLATE utf8_general_ci;
Grant proper access to the
skyline
database:MariaDB [(none)]> GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'localhost' \ IDENTIFIED BY 'SKYLINE_DBPASS'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON skyline.* TO 'skyline'@'%' \ IDENTIFIED BY 'SKYLINE_DBPASS';
Replace
SKYLINE_DBPASS
with a suitable password.Exit the database access client.
Source the
admin
credentials to gain access to admin-only CLI commands:$ . admin-openrc
To create the service credentials, complete these steps:
Create a
skyline
user:$ openstack user create --domain default --password-prompt skyline User Password: Repeat User Password: +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | domain_id | default | | enabled | True | | id | 1qaz2wsx3edc4rfv5tgb6yhn7ujm8ikl | | name | skyline | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+
Add the
admin
role to theskyline
user:$ openstack role add --project service --user skyline admin
Note
This command provides no output.
Install and configure components¶
We will install the Skyline APIServer service from docker image.
Pull the Skyline APIServer service image from Docker Hub:
$ sudo docker pull 99cloud/skyline:latest
Ensure that some folders of skyline-apiserver have been created
$ sudo mkdir -p /etc/skyline /var/log/skyline /var/lib/skyline /var/log/nginx
Set all value from Settings Reference into the configuration file
/etc/skyline/skyline.yaml
Note
Change the related configuration in
/etc/skyline/skyline.yaml
. Detailed introduction of the configuration can be found in Settings Reference.default: database_url: mysql://skyline:SKYLINE_DBPASS@DB_SERVER:3306/skyline debug: true log_dir: /var/log openstack: keystone_url: http://KEYSTONE_SERVER:5000/v3/ system_user_password: SKYLINE_SERVICE_PASSWORD
Replace
SKYLINE_DBPASS
,DB_SERVER
,KEYSTONE_SERVER
andSKYLINE_SERVICE_PASSWORD
with a correct value.
Finalize installation¶
Run bootstrap server
$ sudo docker run -d --name skyline_bootstrap \ -e KOLLA_BOOTSTRAP="" \ -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml \ -v /var/log:/var/log \ --net=host 99cloud/skyline:latest
If you see the following message, it means that the bootstrap server is successful: + echo '/usr/local/bin/gunicorn -c /etc/skyline/gunicorn.py skyline_apiserver.main:app' + mapfile -t CMD ++ xargs -n 1 ++ tail /run_command + [[ -n 0 ]] + cd /skyline-apiserver/ + make db_sync alembic -c skyline_apiserver/db/alembic/alembic.ini upgrade head 2022-08-19 07:49:16.004 | INFO | alembic.runtime.migration:__init__:204 - Context impl MySQLImpl. 2022-08-19 07:49:16.005 | INFO | alembic.runtime.migration:__init__:207 - Will assume non-transactional DDL. + exit 0
Cleanup bootstrap server
$ sudo docker rm -f skyline_bootstrap
Run skyline-apiserver
$ sudo docker run -d --name skyline --restart=always \ -v /etc/skyline/skyline.yaml:/etc/skyline/skyline.yaml \ -v /var/log:/var/log \ --net=host 99cloud/skyline:latest
Note
The skyline image is both include skyline-apiserver and skyline-console. And the skyline-apiserver is bound as socket file
/var/lib/skyline/skyline.sock
.So you can not access the skyline-apiserver openapi swagger. But now you can visit the skyline UI
https://xxxxx:9999
.Note
If you need to modify skyline port, add
-e LISTEN_ADDRESS=<ip:port>
in run command. Default port is 9999.