Nova: move to startup scripts.

This PS moves the container start commands to scripts, which makes
debugging and overriding of container launch params easier.

Change-Id: Ibf5cda2218111360183b8a5eb993c717be84076c
This commit is contained in:
Pete Birley 2017-05-01 11:49:31 -05:00
parent 6d788c7eff
commit 60d01e54cc
14 changed files with 189 additions and 25 deletions

View File

@ -0,0 +1,19 @@
#!/bin/bash
# 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.
set -x
exec nova-api-metadata \
--config-file /etc/nova/nova.conf

View File

@ -0,0 +1,19 @@
#!/bin/bash
# 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.
set -x
exec nova-api \
--config-file /etc/nova/nova.conf

View File

@ -0,0 +1,19 @@
#!/bin/bash
# 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.
set -x
exec nova-compute \
--config-file /etc/nova/nova.conf

View File

@ -0,0 +1,19 @@
#!/bin/bash
# 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.
set -x
exec nova-conductor \
--config-file /etc/nova/nova.conf

View File

@ -0,0 +1,19 @@
#!/bin/bash
# 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.
set -x
exec nova-consoleauth \
--config-file /etc/nova/nova.conf

View File

@ -0,0 +1,19 @@
#!/bin/bash
# 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.
set -x
exec nova-scheduler \
--config-file /etc/nova/nova.conf

View File

@ -31,3 +31,15 @@ data:
{{ tuple "bin/_libvirt.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
bootstrap.sh: |
{{ tuple "bin/_bootstrap.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
nova-api-metadata.sh: |
{{ tuple "bin/_nova-api-metadata.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
nova-api-osapi.sh: |
{{ tuple "bin/_nova-api-osapi.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
nova-compute.sh: |
{{ tuple "bin/_nova-compute.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
nova-conductor.sh: |
{{ tuple "bin/_nova-conductor.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
nova-consoleauth.sh: |
{{ tuple "bin/_nova-consoleauth.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
nova-scheduler.sh: |
{{ tuple "bin/_nova-scheduler.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}

View File

@ -56,10 +56,13 @@ spec:
securityContext:
privileged: true
command:
- nova-compute
- --config-file
- /etc/nova/nova.conf
- bash
- /tmp/nova-compute.sh
volumeMounts:
- name: nova-bin
mountPath: /tmp/nova-compute.sh
subPath: nova-compute.sh
readOnly: true
- name: nova-etc
mountPath: /etc/nova/nova.conf
subPath: nova.conf
@ -93,6 +96,9 @@ spec:
mountPath: /sys/fs/cgroup
{{ if $mounts_nova_compute.volumeMounts }}{{ toYaml $mounts_nova_compute.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: nova-bin
configMap:
name: nova-bin
- name: nova-etc
configMap:
name: nova-etc

View File

@ -57,14 +57,14 @@ spec:
- bash
- /tmp/libvirt.sh
volumeMounts:
- name: nova-etc
mountPath: /etc/libvirt/libvirtd.conf
subPath: libvirtd.conf
readOnly: true
- name: nova-bin
mountPath: /tmp/libvirt.sh
subPath: libvirt.sh
readOnly: true
- name: nova-etc
mountPath: /etc/libvirt/libvirtd.conf
subPath: libvirtd.conf
readOnly: true
- name: nova-etc
mountPath: /etc/nova/nova.conf
subPath: nova.conf
@ -100,12 +100,12 @@ spec:
{{- end }}
{{ if $mounts_nova_libvirt.volumeMounts }}{{ toYaml $mounts_nova_libvirt.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: nova-etc
configMap:
name: nova-etc
- name: nova-bin
configMap:
name: nova-bin
- name: nova-etc
configMap:
name: nova-etc
- name: libmodules
hostPath:
path: /lib/modules

View File

@ -61,15 +61,19 @@ spec:
capabilities:
add:
- NET_ADMIN
command:
- nova-api-metadata
- --config-file=/etc/nova/nova.conf
ports:
- containerPort: {{ .Values.network.metadata.port }}
readinessProbe:
tcpSocket:
port: {{ .Values.network.metadata.port }}
command:
- bash
- /tmp/nova-api-metadata.sh
volumeMounts:
- name: nova-bin
mountPath: /tmp/nova-api-metadata.sh
subPath: nova-api-metadata.sh
readOnly: true
- name: nova-etc
mountPath: /etc/nova/nova.conf
subPath: nova.conf
@ -80,6 +84,9 @@ spec:
readOnly: true
{{ if $mounts_nova_api_metadata.volumeMounts }}{{ toYaml $mounts_nova_api_metadata.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: nova-bin
configMap:
name: nova-bin
- name: nova-etc
configMap:
name: nova-etc

View File

@ -60,15 +60,19 @@ spec:
memory: {{ .Values.resources.nova_osapi.limits.memory | quote }}
cpu: {{ .Values.resources.nova_osapi.limits.cpu | quote }}
{{- end }}
command:
- nova-api
- --config-file=/etc/nova/nova.conf
ports:
- containerPort: {{ .Values.network.osapi.port }}
readinessProbe:
tcpSocket:
port: {{ .Values.network.osapi.port }}
command:
- bash
- /tmp/nova-api.sh
volumeMounts:
- name: nova-bin
mountPath: /tmp/nova-api.sh
subPath: nova-api.sh
readOnly: true
- name: nova-etc
mountPath: /etc/nova/nova.conf
subPath: nova.conf
@ -79,6 +83,9 @@ spec:
readOnly: true
{{ if $mounts_nova_api_osapi.volumeMounts }}{{ toYaml $mounts_nova_api_osapi.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: nova-bin
configMap:
name: nova-bin
- name: nova-etc
configMap:
name: nova-etc

View File

@ -57,16 +57,22 @@ spec:
cpu: {{ .Values.resources.nova_conductor.limits.cpu | quote }}
{{- end }}
command:
- nova-conductor
- --config-file
- /etc/nova/nova.conf
- bash
- /tmp/nova-conductor.sh
volumeMounts:
- name: nova-bin
mountPath: /tmp/nova-conductor.sh
subPath: nova-conductor.sh
readOnly: true
- name: nova-etc
mountPath: /etc/nova/nova.conf
subPath: nova.conf
readOnly: true
{{ if $mounts_nova_conductor.volumeMounts }}{{ toYaml $mounts_nova_conductor.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: nova-bin
configMap:
name: nova-bin
- name: nova-etc
configMap:
name: nova-etc

View File

@ -58,16 +58,22 @@ spec:
cpu: {{ .Values.resources.nova_consoleauth.limits.cpu | quote }}
{{- end }}
command:
- nova-consoleauth
- --config-file
- /etc/nova/nova.conf
- bash
- /tmp/nova-consoleauth.sh
volumeMounts:
- name: nova-bin
mountPath: /tmp/nova-consoleauth.sh
subPath: nova-consoleauth.sh
readOnly: true
- name: nova-etc
mountPath: /etc/nova/nova.conf
subPath: nova.conf
readOnly: true
{{ if $mounts_nova_consoleauth.volumeMounts }}{{ toYaml $mounts_nova_consoleauth.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: nova-bin
configMap:
name: nova-bin
- name: nova-etc
configMap:
name: nova-etc

View File

@ -58,16 +58,22 @@ spec:
cpu: {{ .Values.resources.nova_scheduler.limits.cpu | quote }}
{{- end }}
command:
- nova-scheduler
- --config-file
- /etc/nova/nova.conf
- bash
- /tmp/nova-scheduler.sh
volumeMounts:
- name: nova-bin
mountPath: /tmp/nova-scheduler.sh
subPath: nova-scheduler.sh
readOnly: true
- name: nova-etc
mountPath: /etc/nova/nova.conf
subPath: nova.conf
readOnly: true
{{ if $mounts_nova_scheduler.volumeMounts }}{{ toYaml $mounts_nova_scheduler.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: nova-bin
configMap:
name: nova-bin
- name: nova-etc
configMap:
name: nova-etc