Switch trove-api to wsgi running under apache.
This change also adds support for Trove backend TLS. Depends-On: https://review.opendev.org/c/openstack/kolla/+/854744 Change-Id: I2acf7820b24b112b57b0c00a01f5c4b8cb85ce25
This commit is contained in:
parent
66ec9cef55
commit
303998e294
@ -541,6 +541,7 @@ syslog_udp_port: "{{ fluentd_syslog_port }}"
|
|||||||
tacker_server_port: "9890"
|
tacker_server_port: "9890"
|
||||||
|
|
||||||
trove_api_port: "8779"
|
trove_api_port: "8779"
|
||||||
|
trove_api_listen_port: "{{ trove_api_port }}"
|
||||||
|
|
||||||
venus_api_port: "10010"
|
venus_api_port: "10010"
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
capitalize_regex_backreference yes
|
capitalize_regex_backreference yes
|
||||||
<rule>
|
<rule>
|
||||||
key programname
|
key programname
|
||||||
pattern ^(cinder-api-access|cloudkitty-api-access|gnocchi-api-access|horizon-access|keystone-apache-admin-access|keystone-apache-public-access|octavia-api-access|placement-api-access)$
|
pattern ^(cinder-api-access|cloudkitty-api-access|gnocchi-api-access|horizon-access|keystone-apache-admin-access|keystone-apache-public-access|octavia-api-access|placement-api-access|trove-api-access)$
|
||||||
tag apache_access
|
tag apache_access
|
||||||
</rule>
|
</rule>
|
||||||
<rule>
|
<rule>
|
||||||
|
@ -14,11 +14,15 @@ trove_services:
|
|||||||
mode: "http"
|
mode: "http"
|
||||||
external: false
|
external: false
|
||||||
port: "{{ trove_api_port }}"
|
port: "{{ trove_api_port }}"
|
||||||
|
listen_port: "{{ trove_api_listen_port }}"
|
||||||
|
tls_backend: "{{ trove_enable_tls_backend }}"
|
||||||
trove_api_external:
|
trove_api_external:
|
||||||
enabled: "{{ enable_trove }}"
|
enabled: "{{ enable_trove }}"
|
||||||
mode: "http"
|
mode: "http"
|
||||||
external: true
|
external: true
|
||||||
port: "{{ trove_api_port }}"
|
port: "{{ trove_api_port }}"
|
||||||
|
listen_port: "{{ trove_api_listen_port }}"
|
||||||
|
tls_backend: "{{ trove_enable_tls_backend }}"
|
||||||
trove-conductor:
|
trove-conductor:
|
||||||
container_name: trove_conductor
|
container_name: trove_conductor
|
||||||
group: trove-conductor
|
group: trove-conductor
|
||||||
@ -198,3 +202,8 @@ trove_ks_users:
|
|||||||
user: "{{ trove_keystone_user }}"
|
user: "{{ trove_keystone_user }}"
|
||||||
password: "{{ trove_keystone_password }}"
|
password: "{{ trove_keystone_password }}"
|
||||||
role: "admin"
|
role: "admin"
|
||||||
|
|
||||||
|
####################
|
||||||
|
# TLS
|
||||||
|
####################
|
||||||
|
trove_enable_tls_backend: "{{ kolla_enable_tls_backend }}"
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
- include_tasks: copy-certs.yml
|
- include_tasks: copy-certs.yml
|
||||||
when:
|
when:
|
||||||
- kolla_copy_ca_into_containers | bool
|
- kolla_copy_ca_into_containers | bool or trove_enable_tls_backend | bool
|
||||||
|
|
||||||
- name: Copying over config.json files for services
|
- name: Copying over config.json files for services
|
||||||
template:
|
template:
|
||||||
@ -48,6 +48,24 @@
|
|||||||
notify:
|
notify:
|
||||||
- "Restart {{ item.key }} container"
|
- "Restart {{ item.key }} container"
|
||||||
|
|
||||||
|
- name: Copying over trove-wsgi.conf
|
||||||
|
vars:
|
||||||
|
service: "{{ trove_services['trove-api'] }}"
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ item }}"
|
||||||
|
dest: "{{ node_config_directory }}/trove-api/trove-wsgi.conf"
|
||||||
|
mode: "0660"
|
||||||
|
with_first_found:
|
||||||
|
- "{{ node_custom_config }}/trove/{{ inventory_hostname }}/trove-wsgi.conf"
|
||||||
|
- "{{ node_custom_config }}/trove/trove-wsgi.conf"
|
||||||
|
- "trove-wsgi.conf.j2"
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups[service.group]
|
||||||
|
- service.enabled | bool
|
||||||
|
notify:
|
||||||
|
- Restart trove-api container
|
||||||
|
|
||||||
- name: Copying over trove-guestagent.conf
|
- name: Copying over trove-guestagent.conf
|
||||||
vars:
|
vars:
|
||||||
services_need_confs:
|
services_need_confs:
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
- name: Checking free port for Trove API
|
- name: Checking free port for Trove API
|
||||||
wait_for:
|
wait_for:
|
||||||
host: "{{ api_interface_address }}"
|
host: "{{ api_interface_address }}"
|
||||||
port: "{{ trove_api_port }}"
|
port: "{{ trove_api_listen_port }}"
|
||||||
connect_timeout: 1
|
connect_timeout: 1
|
||||||
timeout: 1
|
timeout: 1
|
||||||
state: stopped
|
state: stopped
|
||||||
|
@ -1,24 +1,48 @@
|
|||||||
|
{% set apache_binary = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
|
||||||
|
{% set apache_conf_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %}
|
||||||
{
|
{
|
||||||
"command": "trove-api --config-file=/etc/trove/trove.conf",
|
"command": "/usr/sbin/{{ apache_binary }} -DFOREGROUND",
|
||||||
"config_files": [
|
"config_files": [
|
||||||
{
|
{
|
||||||
"source": "{{ container_config_directory }}/trove.conf",
|
"source": "{{ container_config_directory }}/trove.conf",
|
||||||
"dest": "/etc/trove/trove.conf",
|
"dest": "/etc/trove/trove.conf",
|
||||||
"owner": "trove",
|
"owner": "trove",
|
||||||
"perm": "0600"
|
"perm": "0600"
|
||||||
}{% if trove_policy_file is defined %},
|
},
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/trove-wsgi.conf",
|
||||||
|
"dest": "/etc/{{ apache_conf_dir }}/trove-wsgi.conf",
|
||||||
|
"owner": "trove",
|
||||||
|
"perm": "0600"
|
||||||
|
}{% if trove_policy_file is defined %},
|
||||||
{
|
{
|
||||||
"source": "{{ container_config_directory }}/{{ trove_policy_file }}",
|
"source": "{{ container_config_directory }}/{{ trove_policy_file }}",
|
||||||
"dest": "/etc/trove/{{ trove_policy_file }}",
|
"dest": "/etc/trove/{{ trove_policy_file }}",
|
||||||
"owner": "trove",
|
"owner": "trove",
|
||||||
"perm": "0600"
|
"perm": "0600"
|
||||||
}{% endif %}
|
}{% endif %}{% if trove_enable_tls_backend | bool %},
|
||||||
],
|
{
|
||||||
|
"source": "{{ container_config_directory }}/trove-cert.pem",
|
||||||
|
"dest": "/etc/trove/certs/trove-cert.pem",
|
||||||
|
"owner": "trove",
|
||||||
|
"perm": "0600"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/trove-key.pem",
|
||||||
|
"dest": "/etc/trove/certs/trove-key.pem",
|
||||||
|
"owner": "trove",
|
||||||
|
"perm": "0600"
|
||||||
|
}
|
||||||
|
{% endif %}],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"path": "/var/log/kolla/trove",
|
"path": "/var/log/kolla/trove",
|
||||||
"owner": "trove:trove",
|
"owner": "trove:trove",
|
||||||
"recurse": true
|
"recurse": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/var/run/trove",
|
||||||
|
"owner": "trove:trove"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
43
ansible/roles/trove/templates/trove-wsgi.conf.j2
Normal file
43
ansible/roles/trove/templates/trove-wsgi.conf.j2
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{% set wsgi_directory = '/var/lib/kolla/venv/bin' %}
|
||||||
|
{% if trove_enable_tls_backend | bool %}
|
||||||
|
{% if kolla_base_distro in ['centos'] %}
|
||||||
|
LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so
|
||||||
|
{% else %}
|
||||||
|
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
Listen {{ api_interface_address | put_address_in_context('url') }}:{{ trove_api_listen_port }}
|
||||||
|
|
||||||
|
ServerSignature Off
|
||||||
|
ServerTokens Prod
|
||||||
|
TraceEnable off
|
||||||
|
TimeOut {{ kolla_httpd_timeout }}
|
||||||
|
KeepAliveTimeout {{ kolla_httpd_keep_alive }}
|
||||||
|
|
||||||
|
{% if trove_logging_debug | bool %}
|
||||||
|
LogLevel info
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<VirtualHost *:{{ trove_api_listen_port }}>
|
||||||
|
WSGIDaemonProcess trove-api processes={{ trove_api_workers }} threads=1 user=trove group=trove display-name=trove-api
|
||||||
|
WSGIProcessGroup trove-api
|
||||||
|
WSGIScriptAlias / {{ wsgi_directory }}/trove-wsgi
|
||||||
|
WSGIApplicationGroup %{GLOBAL}
|
||||||
|
WSGIPassAuthorization On
|
||||||
|
<IfVersion >= 2.4>
|
||||||
|
ErrorLogFormat "%{cu}t %M"
|
||||||
|
</IfVersion>
|
||||||
|
ErrorLog /var/log/kolla/trove/trove-api-error.log
|
||||||
|
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat
|
||||||
|
CustomLog /var/log/kolla/trove/trove-api-access.log logformat
|
||||||
|
<Directory {{ wsgi_directory }}>
|
||||||
|
<Files trove-wsgi>
|
||||||
|
Require all granted
|
||||||
|
</Files>
|
||||||
|
</Directory>
|
||||||
|
{% if trove_enable_tls_backend | bool %}
|
||||||
|
SSLEngine On
|
||||||
|
SSLCertificateFile /etc/trove/certs/trove-cert.pem
|
||||||
|
SSLCertificateKeyFile /etc/trove/certs/trove-key.pem
|
||||||
|
{% endif %}
|
||||||
|
</VirtualHost>
|
@ -2,10 +2,13 @@
|
|||||||
debug = {{ trove_logging_debug }}
|
debug = {{ trove_logging_debug }}
|
||||||
|
|
||||||
log_dir = /var/log/kolla/trove
|
log_dir = /var/log/kolla/trove
|
||||||
|
{% if service_name == "trove-api" %}
|
||||||
|
log_file = trove-api.log
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
host = {{ api_interface_address }}
|
host = {{ api_interface_address }}
|
||||||
|
|
||||||
bind_port = {{ trove_api_port }}
|
bind_port = {{ trove_api_listen_port }}
|
||||||
bind_host = {{ api_interface_address }}
|
bind_host = {{ api_interface_address }}
|
||||||
trove_api_workers = {{ trove_api_workers }}
|
trove_api_workers = {{ trove_api_workers }}
|
||||||
auth_strategy = keystone
|
auth_strategy = keystone
|
||||||
|
7
releasenotes/notes/trove-api-wsgi-bd6a3a5ab26fe896.yaml
Normal file
7
releasenotes/notes/trove-api-wsgi-bd6a3a5ab26fe896.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Switch ``trove-api`` to WSGI running under Apache.
|
||||||
|
- |
|
||||||
|
Added configuration options to enable backend TLS encryption from HAProxy
|
||||||
|
to the Trove service.
|
Loading…
Reference in New Issue
Block a user