Skip to content

Commit 8b72f48

Browse files
committed
Migrate Designate Operator to uwsgi
mod_wsgi is being removed from upstream sources but OpenStack APIs are still using it downstream, which is very concerning. This patch aims to replace mod_wsgi with uwsgi. Depends-On: openstack-k8s-operators/tcib#282
1 parent 565e4c4 commit 8b72f48

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

templates/designateapi/bin/init.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ done
3939
# NOTE:dkehn - REMOVED because Kolla_set & start copy eveyrthing.
4040
# I'm doing this to get the designate.conf w/all the tags with values.
4141
cp -a ${SVC_CFG_MERGED} ${SVC_CFG}
42+
43+
echo "Starting Apache"
44+
/usr/sbin/httpd -DFOREGROUND &

templates/designateapi/config/designate-api-config.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"command": "/usr/sbin/httpd -DFOREGROUND",
2+
"command": "/usr/bin/uwsgi --ini /etc/designate/designate-api-uwsgi.ini",
33
"config_files": [
44
{
55
"source": "/var/lib/config-data/merged/designate.conf",
@@ -31,6 +31,12 @@
3131
"owner": "root",
3232
"perm": "0644"
3333
},
34+
{
35+
"source": "/var/lib/config-data/merged/designate-api-uwsgi.ini",
36+
"dest": "/etc/designate/designate-api-uwsgi.ini",
37+
"owner": "designate",
38+
"perm": "0600"
39+
},
3440
{
3541
"source": "/var/lib/config-data/tls/certs/*",
3642
"dest": "/etc/pki/tls/certs/",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# copied from our u/s jobs, we probably need to change some config options here
2+
[uwsgi]
3+
http-socket = 127.0.0.1:60053
4+
chmod-socket = 666
5+
socket = /var/run/uwsgi/designate-api-wsgi.socket
6+
start-time = %t
7+
lazy-apps = true
8+
add-header = Connection: close
9+
buffer-size = 65535
10+
hook-master-start = unix_signal:15 gracefully_kill_them_all
11+
thunder-lock = true
12+
plugins = http,python3
13+
enable-threads = true
14+
worker-reload-mercy = 80
15+
exit-on-reload = false
16+
die-on-term = true
17+
master = true
18+
processes = 2
19+
module = designate.wsgi.api:application

templates/designateapi/config/httpd.conf

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@ TimeOut {{ $.TimeOut }}
4646
SSLCertificateKeyFile "{{ $vhost.SSLCertificateKeyFile }}"
4747
{{- end }}
4848

49-
## WSGI configuration
50-
WSGIProcessGroup {{ $endpt }}
51-
WSGIApplicationGroup %{GLOBAL}
52-
WSGIPassAuthorization On
53-
WSGIDaemonProcess {{ $endpt }} processes=5 threads=1 user=designate group=designate display-name={{ $endpt }}
54-
WSGIScriptAlias / "/usr/bin/designate-api-wsgi"
49+
# ProxyPass configuration for uwsgi
50+
ProxyPass "/dns" "http://127.0.0.1:60053" retry=0
51+
5552
</VirtualHost>
5653
{{ end }}

0 commit comments

Comments
 (0)