Merge "Nova: Move placement API to run behind Apache"
This commit is contained in:
commit
48a4d0cfba
@ -20,12 +20,20 @@ set -ex
|
|||||||
COMMAND="${@:-start}"
|
COMMAND="${@:-start}"
|
||||||
|
|
||||||
function start () {
|
function start () {
|
||||||
exec nova-placement-api \
|
|
||||||
--port {{ .Values.network.placement.port }}
|
cp -a $(type -p nova-placement-api) /var/www/cgi-bin/nova/
|
||||||
|
|
||||||
|
if [ -f /etc/apache2/envvars ]; then
|
||||||
|
# Loading Apache2 ENV variables
|
||||||
|
source /etc/apache2/envvars
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start Apache2
|
||||||
|
exec apache2 -DFOREGROUND
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop () {
|
function stop () {
|
||||||
kill -TERM 1
|
apachectl -k graceful-stop
|
||||||
}
|
}
|
||||||
|
|
||||||
$COMMAND
|
$COMMAND
|
||||||
|
@ -149,6 +149,8 @@ data:
|
|||||||
{{- tuple .Values.conf.rootwrap_filters.network "etc/rootwrap.d/_network.filters.tpl" . | include "helm-toolkit.utils.configmap_templater" }}
|
{{- tuple .Values.conf.rootwrap_filters.network "etc/rootwrap.d/_network.filters.tpl" . | include "helm-toolkit.utils.configmap_templater" }}
|
||||||
nova.conf: |+
|
nova.conf: |+
|
||||||
{{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.nova | indent 4 }}
|
{{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.nova | indent 4 }}
|
||||||
|
wsgi-nova-placement.conf: |+
|
||||||
|
{{- tuple .Values.conf.wsgi_placement "etc/_wsgi-nova-placement.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }}
|
||||||
ssh-config.sh: |+
|
ssh-config.sh: |+
|
||||||
{{- tuple .Values.conf.ssh "etc/_ssh-config.tpl" . | include "helm-toolkit.utils.configmap_templater" }}
|
{{- tuple .Values.conf.ssh "etc/_ssh-config.tpl" . | include "helm-toolkit.utils.configmap_templater" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -62,6 +62,8 @@ spec:
|
|||||||
tcpSocket:
|
tcpSocket:
|
||||||
port: {{ .Values.network.placement.port }}
|
port: {{ .Values.network.placement.port }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
- name: wsgi-nova
|
||||||
|
mountPath: /var/www/cgi-bin/nova
|
||||||
- name: nova-bin
|
- name: nova-bin
|
||||||
mountPath: /tmp/nova-placement-api.sh
|
mountPath: /tmp/nova-placement-api.sh
|
||||||
subPath: nova-placement-api.sh
|
subPath: nova-placement-api.sh
|
||||||
@ -78,8 +80,14 @@ spec:
|
|||||||
mountPath: /etc/nova/policy.yaml
|
mountPath: /etc/nova/policy.yaml
|
||||||
subPath: policy.yaml
|
subPath: policy.yaml
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
- name: nova-etc
|
||||||
|
mountPath: /etc/apache2/conf-enabled/wsgi-nova-placement.conf
|
||||||
|
subPath: wsgi-nova-placement.conf
|
||||||
|
readOnly: true
|
||||||
{{- if $mounts_nova_placement.volumeMounts }}{{ toYaml $mounts_nova_placement.volumeMounts | indent 12 }}{{ end }}
|
{{- if $mounts_nova_placement.volumeMounts }}{{ toYaml $mounts_nova_placement.volumeMounts | indent 12 }}{{ end }}
|
||||||
volumes:
|
volumes:
|
||||||
|
- name: wsgi-nova
|
||||||
|
emptyDir: {}
|
||||||
- name: nova-bin
|
- name: nova-bin
|
||||||
configMap:
|
configMap:
|
||||||
name: nova-bin
|
name: nova-bin
|
||||||
|
50
nova/templates/etc/_wsgi-nova-placement.conf.tpl
Normal file
50
nova/templates/etc/_wsgi-nova-placement.conf.tpl
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
Listen 0.0.0.0:{{ .Values.network.placement.port }}
|
||||||
|
|
||||||
|
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
||||||
|
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
|
||||||
|
|
||||||
|
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
|
||||||
|
CustomLog /dev/stdout combined env=!forwarded
|
||||||
|
CustomLog /dev/stdout proxy env=forwarded
|
||||||
|
|
||||||
|
<VirtualHost *:{{ .Values.network.placement.port }}>
|
||||||
|
WSGIDaemonProcess placement-api processes=1 threads=4 user=nova group=nova display-name=%{GROUP}
|
||||||
|
WSGIProcessGroup placement-api
|
||||||
|
WSGIScriptAlias / /var/www/cgi-bin/nova/nova-placement-api
|
||||||
|
WSGIApplicationGroup %{GLOBAL}
|
||||||
|
WSGIPassAuthorization On
|
||||||
|
<IfVersion >= 2.4>
|
||||||
|
ErrorLogFormat "%{cu}t %M"
|
||||||
|
</IfVersion>
|
||||||
|
ErrorLog /dev/stdout
|
||||||
|
|
||||||
|
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
|
||||||
|
CustomLog /dev/stdout combined env=!forwarded
|
||||||
|
CustomLog /dev/stdout proxy env=forwarded
|
||||||
|
</VirtualHost>
|
||||||
|
|
||||||
|
Alias /placement /var/www/cgi-bin/nova/nova-placement-api
|
||||||
|
<Location /placement>
|
||||||
|
SetHandler wsgi-script
|
||||||
|
Options +ExecCGI
|
||||||
|
|
||||||
|
WSGIProcessGroup placement-api
|
||||||
|
WSGIApplicationGroup %{GLOBAL}
|
||||||
|
WSGIPassAuthorization On
|
||||||
|
</Location>
|
@ -941,6 +941,9 @@ conf:
|
|||||||
rootwrap:
|
rootwrap:
|
||||||
override:
|
override:
|
||||||
append:
|
append:
|
||||||
|
wsgi_placement:
|
||||||
|
override:
|
||||||
|
append:
|
||||||
rootwrap_filters:
|
rootwrap_filters:
|
||||||
api_metadata:
|
api_metadata:
|
||||||
override:
|
override:
|
||||||
|
Loading…
Reference in New Issue
Block a user