Cinder: Support uWSGI for API server

Currently Cinder 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: Iccdfaba66af6e814b7c28bf682b0d2bface2d982
This commit is contained in:
ricolin 2023-11-01 15:20:43 +08:00
parent 6ac304d752
commit f65cb36c84
6 changed files with 35 additions and 4 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Cinder description: OpenStack-Helm Cinder
name: cinder name: cinder
version: 0.3.16 version: 0.3.17
home: https://docs.openstack.org/cinder/latest/ home: https://docs.openstack.org/cinder/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Cinder/OpenStack_Project_Cinder_vertical.png icon: https://www.openstack.org/themes/openstack/images/project-mascots/Cinder/OpenStack_Project_Cinder_vertical.png
sources: sources:

View File

@ -48,8 +48,7 @@ function start () {
# Starts Apache2 # Starts Apache2
exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }} exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }}
{{- else }} {{- else }}
exec cinder-api \ exec uwsgi --ini /etc/cinder/cinder-api-uwsgi.ini
--config-file /etc/cinder/cinder.conf
{{- end }} {{- end }}
} }

View File

@ -144,6 +144,15 @@ limitations under the License.
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- if empty .Values.conf.cinder_api_uwsgi.uwsgi.processes -}}
{{- $_ := set .Values.conf.cinder_api_uwsgi.uwsgi "processes" .Values.conf.cinder.DEFAULT.osapi_volume_workers -}}
{{- end -}}
{{- if empty (index .Values.conf.cinder_api_uwsgi.uwsgi "http-socket") -}}
{{- $http_socket_port := tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }}
{{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }}
{{- $_ := set .Values.conf.cinder_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" }}
@ -168,6 +177,7 @@ data:
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 }}
backends.conf: {{ include "helm-toolkit.utils.to_ini" .Values.conf.backends | b64enc }} backends.conf: {{ include "helm-toolkit.utils.to_ini" .Values.conf.backends | b64enc }}
api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }} api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }}
cinder-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.cinder_api_uwsgi | b64enc }}
policy.yaml: {{ toYaml .Values.conf.policy | b64enc }} policy.yaml: {{ toYaml .Values.conf.policy | b64enc }}
{{- if .Values.manifests.certificates }} {{- if .Values.manifests.certificates }}
{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.mpm_event "key" "mpm_event.conf" "format" "Secret" ) | indent 2 }} {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.mpm_event "key" "mpm_event.conf" "format" "Secret" ) | indent 2 }}

View File

@ -104,7 +104,7 @@ spec:
scheme: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }} scheme: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: / path: /
port: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} port: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 30 initialDelaySeconds: 5
failureThreshold: 3 failureThreshold: 3
periodSeconds: 10 periodSeconds: 10
successThreshold: 1 successThreshold: 1
@ -118,6 +118,10 @@ spec:
mountPath: /tmp/cinder-api.sh mountPath: /tmp/cinder-api.sh
subPath: cinder-api.sh subPath: cinder-api.sh
readOnly: true readOnly: true
- name: cinder-etc
mountPath: /etc/cinder/cinder-api-uwsgi.ini
subPath: cinder-api-uwsgi.ini
readOnly: true
- name: cinder-etc - name: cinder-etc
mountPath: /etc/cinder/cinder.conf mountPath: /etc/cinder/cinder.conf
subPath: cinder.conf subPath: cinder.conf

View File

@ -1011,6 +1011,23 @@ conf:
- volume_type - volume_type
volume_type: [] volume_type: []
enable_iscsi: false enable_iscsi: false
cinder_api_uwsgi:
uwsgi:
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: "cinder-api:"
route-user-agent: '^kube-probe.* donotlog:'
thunder-lock: true
worker-reload-mercy: 80
wsgi-file: /var/lib/openstack/bin/cinder-wsgi
backup: backup:
external_ceph_rbd: external_ceph_rbd:
enabled: false enabled: false

View File

@ -66,4 +66,5 @@ cinder:
- 0.3.14 Add Ubuntu Jammy overrides - 0.3.14 Add Ubuntu Jammy overrides
- 0.3.15 Add 2023.2 Ubuntu Jammy overrides - 0.3.15 Add 2023.2 Ubuntu Jammy overrides
- 0.3.16 Update Ceph images to Jammy and Reef 18.2.1 - 0.3.16 Update Ceph images to Jammy and Reef 18.2.1
- 0.3.17 Use uWSGI for API service
... ...