Octavia: Support uWSGI for API server

Currently Octavia API server still using eventlet-based HTTP servers,
it is generally considered more performant and flexible to run them
using a generic HTTP server that supports WSGI.

Change-Id: I75cfca8b660e0ea949527182e10b463972b3c0fb
This commit is contained in:
ricolin 2023-11-02 14:58:41 +08:00
parent b6e6dad141
commit b0e5d8e3e2
6 changed files with 31 additions and 3 deletions

View File

@ -16,7 +16,7 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Octavia description: OpenStack-Helm Octavia
name: octavia name: octavia
version: 0.2.10 version: 0.2.11
home: https://docs.openstack.org/octavia/latest/ home: https://docs.openstack.org/octavia/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Octavia/OpenStack_Project_Octavia_vertical.png icon: https://www.openstack.org/themes/openstack/images/project-mascots/Octavia/OpenStack_Project_Octavia_vertical.png
sources: sources:

View File

@ -20,8 +20,7 @@ set -ex
COMMAND="${@:-start}" COMMAND="${@:-start}"
function start () { function start () {
exec octavia-api \ exec uwsgi --ini /etc/octavia/octavia-api-uwsgi.ini
--config-file /etc/octavia/octavia.conf
} }
function stop () { function stop () {

View File

@ -88,6 +88,12 @@ limitations under the License.
{{- $_ := tuple "oslo_messaging" "internal" "octavia" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.octavia.DEFAULT "transport_url" -}} {{- $_ := tuple "oslo_messaging" "internal" "octavia" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.octavia.DEFAULT "transport_url" -}}
{{- end -}} {{- end -}}
{{- if empty (index .Values.conf.octavia_api_uwsgi.uwsgi "http-socket") -}}
{{- $http_socket_port := tuple "load_balancer" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }}
{{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }}
{{- $_ := set .Values.conf.octavia_api_uwsgi.uwsgi "http-socket" $http_socket -}}
{{- end -}}
{{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}} {{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}}
{{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }} {{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
{{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
@ -108,6 +114,7 @@ metadata:
type: Opaque type: Opaque
data: data:
octavia.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.octavia | b64enc }} octavia.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.octavia | b64enc }}
octavia-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.octavia_api_uwsgi | b64enc }}
logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }} logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -87,6 +87,10 @@ spec:
mountPath: /etc/octavia/octavia.conf mountPath: /etc/octavia/octavia.conf
subPath: octavia.conf subPath: octavia.conf
readOnly: true readOnly: true
- name: octavia-etc
mountPath: /etc/octavia/octavia-api-uwsgi.ini
subPath: octavia-api-uwsgi.ini
readOnly: true
{{- if .Values.conf.octavia.DEFAULT.log_config_append }} {{- if .Values.conf.octavia.DEFAULT.log_config_append }}
- name: octavia-etc - name: octavia-etc
mountPath: {{ .Values.conf.octavia.DEFAULT.log_config_append }} mountPath: {{ .Values.conf.octavia.DEFAULT.log_config_append }}

View File

@ -331,6 +331,23 @@ conf:
priority: 0 priority: 0
apply-to: all apply-to: all
pattern: '(notifications)\.' pattern: '(notifications)\.'
octavia_api_uwsgi:
uwsgi:
processes: 4
add-header: "Connection: close"
buffer-size: 65535
die-on-term: true
enable-threads: true
exit-on-reload: false
hook-master-start: unix_signal:15 gracefully_kill_them_all
lazy-apps: true
log-x-forwarded-for: true
master: true
procname-prefix-spaced: "octavia-api:"
route-user-agent: '^kube-probe.* donotlog:'
thunder-lock: true
worker-reload-mercy: 80
wsgi-file: /var/lib/openstack/bin/octavia-wsgi
secrets: secrets:
identity: identity:

View File

@ -14,4 +14,5 @@ octavia:
- 0.2.8 Define service_type in keystone_authtoken to support application credentials with access rules - 0.2.8 Define service_type in keystone_authtoken to support application credentials with access rules
- 0.2.9 Use default timeout and retry configs for haproxy_amphora - 0.2.9 Use default timeout and retry configs for haproxy_amphora
- 0.2.10 Fix generating health_manager Role and RoleBinding - 0.2.10 Fix generating health_manager Role and RoleBinding
- 0.2.11 Uses uWSGI for API service
... ...