diff --git a/magnum/Chart.yaml b/magnum/Chart.yaml index 4fae410f1f..dd3110fcd0 100644 --- a/magnum/Chart.yaml +++ b/magnum/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Magnum name: magnum -version: 0.2.9 +version: 0.2.10 home: https://docs.openstack.org/magnum/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Magnum/OpenStack_Project_Magnum_vertical.png sources: diff --git a/magnum/templates/bin/_magnum-api.sh.tpl b/magnum/templates/bin/_magnum-api.sh.tpl index 5786cea4d4..4f82862b79 100644 --- a/magnum/templates/bin/_magnum-api.sh.tpl +++ b/magnum/templates/bin/_magnum-api.sh.tpl @@ -18,8 +18,7 @@ set -ex COMMAND="${@:-start}" function start () { - exec magnum-api \ - --config-file /etc/magnum/magnum.conf + exec uwsgi --ini /etc/magnum/magnum-api-uwsgi.ini } function stop () { diff --git a/magnum/templates/configmap-etc.yaml b/magnum/templates/configmap-etc.yaml index 466e2ae728..247b3f6374 100644 --- a/magnum/templates/configmap-etc.yaml +++ b/magnum/templates/configmap-etc.yaml @@ -71,6 +71,15 @@ limitations under the License. {{- $_ := set .Values.conf.magnum.trust "trustee_domain_admin_password" .Values.endpoints.identity.auth.magnum_stack_user.password -}} {{- end -}} +{{- if empty .Values.conf.magnum_api_uwsgi.uwsgi.processes -}} +{{- $_ := set .Values.conf.magnum_api_uwsgi.uwsgi "processes" .Values.conf.magnum.api.workers -}} +{{- end -}} +{{- if empty (index .Values.conf.magnum_api_uwsgi.uwsgi "http-socket") -}} +{{- $http_socket_port := tuple "container-infra" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }} +{{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }} +{{- $_ := set .Values.conf.magnum_api_uwsgi.uwsgi "http-socket" $http_socket -}} +{{- end -}} + {{- 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_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} @@ -91,6 +100,7 @@ metadata: type: Opaque data: magnum.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.magnum | b64enc }} + magnum-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.magnum_api_uwsgi | b64enc }} logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }} api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }} policy.yaml: {{ toYaml .Values.conf.policy | b64enc }} diff --git a/magnum/templates/deployment-api.yaml b/magnum/templates/deployment-api.yaml index fbb43d2489..9eb4967f8c 100644 --- a/magnum/templates/deployment-api.yaml +++ b/magnum/templates/deployment-api.yaml @@ -75,7 +75,7 @@ spec: scheme: HTTP path: / port: {{ tuple "container-infra" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - initialDelaySeconds: 15 + initialDelaySeconds: 5 periodSeconds: 10 volumeMounts: - name: pod-tmp @@ -92,6 +92,10 @@ spec: mountPath: /etc/magnum/magnum.conf subPath: magnum.conf readOnly: true + - name: magnum-etc + mountPath: /etc/magnum/magnum-api-uwsgi.ini + subPath: magnum-api-uwsgi.ini + readOnly: true {{- if .Values.conf.magnum.DEFAULT.log_config_append }} - name: magnum-etc mountPath: {{ .Values.conf.magnum.DEFAULT.log_config_append }} diff --git a/magnum/values.yaml b/magnum/values.yaml index 91a5055af9..56232eb84a 100644 --- a/magnum/values.yaml +++ b/magnum/values.yaml @@ -157,6 +157,22 @@ conf: formatter_default: format: "%(message)s" datefmt: "%Y-%m-%d %H:%M:%S" + magnum_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: "magnum-api:" + route-user-agent: '^kube-probe.* donotlog:' + thunder-lock: true + worker-reload-mercy: 80 + wsgi-file: /var/lib/openstack/bin/magnum-api-wsgi network: api: diff --git a/releasenotes/notes/magnum.yaml b/releasenotes/notes/magnum.yaml index 51a04aeff7..16531ab70f 100644 --- a/releasenotes/notes/magnum.yaml +++ b/releasenotes/notes/magnum.yaml @@ -13,4 +13,5 @@ magnum: - 0.2.7 Added OCI registry authentication - 0.2.8 Remove default policy rules - 0.2.9 Define service_type in keystone_authtoken to support application credentials with access rules + - 0.2.10 Uses uWSGI for API service ...