diff --git a/.charts.yml b/.charts.yml index 3cc5376cd..d5d807948 100644 --- a/.charts.yml +++ b/.charts.yml @@ -151,14 +151,9 @@ charts: repository: url: https://kubernetes-sigs.github.io/node-feature-discovery/charts - name: nova - version: 0.3.27 + version: 0.3.46 repository: *openstack_helm_repository dependencies: *openstack_helm_dependencies - patches: - gerrit: - review.opendev.org: - - 899809 - - 904250 - name: octavia version: 0.2.9 repository: *openstack_helm_repository diff --git a/charts/nova/Chart.yaml b/charts/nova/Chart.yaml index e21ec81b8..0764f694d 100644 --- a/charts/nova/Chart.yaml +++ b/charts/nova/Chart.yaml @@ -9,4 +9,4 @@ name: nova sources: - https://opendev.org/openstack/nova - https://opendev.org/openstack/openstack-helm -version: 0.3.27 +version: 0.3.46 diff --git a/charts/nova/templates/bin/_cell-setup-init.sh.tpl b/charts/nova/templates/bin/_cell-setup-init.sh.tpl index 953508584..3b6f8e810 100644 --- a/charts/nova/templates/bin/_cell-setup-init.sh.tpl +++ b/charts/nova/templates/bin/_cell-setup-init.sh.tpl @@ -69,3 +69,7 @@ until openstack compute service list --service nova-compute -f value -c State | echo "Waiting for Nova Compute processes to register" sleep 10 done + +{{- if .Values.jobs.cell_setup.extra_command }} +{{ .Values.jobs.cell_setup.extra_command }} +{{- end }} diff --git a/charts/nova/templates/bin/_nova-compute-init.sh.tpl b/charts/nova/templates/bin/_nova-compute-init.sh.tpl index 442e7d6b1..4bc71a393 100644 --- a/charts/nova/templates/bin/_nova-compute-init.sh.tpl +++ b/charts/nova/templates/bin/_nova-compute-init.sh.tpl @@ -26,7 +26,11 @@ migration_interface="{{- .Values.conf.libvirt.live_migration_interface -}}" if [[ -z $migration_interface ]]; then # search for interface with default routing # If there is not default gateway, exit - migration_interface=$(ip -4 route list 0/0 | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1 + migration_network_cidr="{{- .Values.conf.libvirt.live_migration_network_cidr -}}" + if [ -z "${migration_network_cidr}" ] ; then + migration_network_cidr="0/0" + fi + migration_interface=$(ip -4 route list ${migration_network_cidr} | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1 fi migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) @@ -45,7 +49,11 @@ hypervisor_interface="{{- .Values.conf.hypervisor.host_interface -}}" if [[ -z $hypervisor_interface ]]; then # search for interface with default routing # If there is not default gateway, exit - hypervisor_interface=$(ip -4 route list 0/0 | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1 + hypervisor_network_cidr="{{- .Values.conf.hypervisor.host_network_cidr -}}" + if [ -z "${hypervisor_network_cidr}" ] ; then + hypervisor_network_cidr="0/0" + fi + hypervisor_interface=$(ip -4 route list ${hypervisor_network_cidr} | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1 fi hypervisor_address=$(ip a s $hypervisor_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) diff --git a/charts/nova/templates/bin/_nova-console-compute-init.sh.tpl b/charts/nova/templates/bin/_nova-console-compute-init.sh.tpl index cb3333052..b2fb92f0f 100644 --- a/charts/nova/templates/bin/_nova-console-compute-init.sh.tpl +++ b/charts/nova/templates/bin/_nova-console-compute-init.sh.tpl @@ -21,25 +21,25 @@ console_kind="{{- .Values.console.console_kind -}}" if [ "${console_kind}" == "novnc" ] ; then client_address="{{- .Values.conf.nova.vnc.server_proxyclient_address -}}" client_interface="{{- .Values.console.novnc.compute.vncserver_proxyclient_interface -}}" + client_network_cidr="{{- .Values.console.novnc.compute.vncserver_proxyclient_network_cidr -}}" listen_ip="{{- .Values.conf.nova.vnc.server_listen -}}" elif [ "${console_kind}" == "spice" ] ; then client_address="{{- .Values.conf.nova.spice.server_proxyclient_address -}}" client_interface="{{- .Values.console.spice.compute.server_proxyclient_interface -}}" + client_network_cidr="{{- .Values.console.spice.compute.server_proxyclient_network_cidr -}}" listen_ip="{{- .Values.conf.nova.spice.server_listen -}}" fi if [ -z "${client_address}" ] ; then if [ -z "${client_interface}" ] ; then - if [ -x "$(command -v route)" ] ; then - # search for interface with default routing, if multiple default routes exist then select the one with the lowest metric. - client_interface=$(route -n | awk '/^0.0.0.0/ { print $5 " " $NF }' | sort | awk '{ print $NF; exit }') - else - client_interface=$(ip r | grep default | awk '{print $5}') + if [ -z "${client_network_cidr}" ] ; then + client_network_cidr="0/0" fi + client_interface=$(ip -4 route list ${client_network_cidr} | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1 fi # determine client ip dynamically based on interface provided - client_address=$(ip a s $client_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -n 1) + client_address=$(ip a s $client_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) fi if [ -z "${listen_ip}" ] ; then diff --git a/charts/nova/templates/bin/_nova-console-proxy-init.sh.tpl b/charts/nova/templates/bin/_nova-console-proxy-init.sh.tpl index f3522c9c2..4eedda9e9 100644 --- a/charts/nova/templates/bin/_nova-console-proxy-init.sh.tpl +++ b/charts/nova/templates/bin/_nova-console-proxy-init.sh.tpl @@ -21,25 +21,25 @@ console_kind="{{- .Values.console.console_kind -}}" if [ "${console_kind}" == "novnc" ] ; then client_address="{{- .Values.conf.nova.vnc.server_proxyclient_address -}}" client_interface="{{- .Values.console.novnc.vncproxy.vncserver_proxyclient_interface -}}" + client_network_cidr="{{- .Values.console.novnc.vncproxy.vncserver_proxyclient_network_cidr -}}" listen_ip="{{- .Values.conf.nova.vnc.server_listen -}}" elif [ "${console_kind}" == "spice" ] ; then client_address="{{- .Values.conf.nova.spice.server_proxyclient_address -}}" client_interface="{{- .Values.console.spice.proxy.server_proxyclient_interface -}}" + client_network_cidr="{{- .Values.console.spice.proxy.server_proxyclient_network_cidr -}}" listen_ip="{{- .Values.conf.nova.spice.server_listen -}}" fi if [ -z "${client_address}" ] ; then if [ -z "${client_interface}" ] ; then - if [ -x "$(command -v route)" ] ; then - # search for interface with default routing, if multiple default routes exist then select the one with the lowest metric. - client_interface=$(route -n | awk '/^0.0.0.0/ { print $5 " " $NF }' | sort | awk '{ print $NF; exit }') - else - client_interface=$(ip r | grep default | awk '{print $5}') + if [ -z "${client_network_cidr}" ] ; then + client_network_cidr="0/0" fi + client_interface=$(ip -4 route list ${client_network_cidr} | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1 fi # determine client ip dynamically based on interface provided - client_address=$(ip a s $client_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -n 1) + client_address=$(ip a s $client_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) fi if [ -z "${listen_ip}" ] ; then diff --git a/charts/nova/templates/bin/_nova-service-cleaner.sh.tpl b/charts/nova/templates/bin/_nova-service-cleaner.sh.tpl index 22427576e..978ca6d0f 100644 --- a/charts/nova/templates/bin/_nova-service-cleaner.sh.tpl +++ b/charts/nova/templates/bin/_nova-service-cleaner.sh.tpl @@ -30,3 +30,7 @@ for NOVA_SERVICE in ${NOVA_SERVICES_TO_CLEAN}; do openstack compute service delete "${SERVICE_ID}" done done + +{{- if .Values.jobs.service_cleaner.extra_command }} +{{ .Values.jobs.service_cleaner.extra_command }} +{{- end }} diff --git a/charts/nova/templates/bin/_ssh-start.sh.tpl b/charts/nova/templates/bin/_ssh-start.sh.tpl index 562da442d..feca575bc 100644 --- a/charts/nova/templates/bin/_ssh-start.sh.tpl +++ b/charts/nova/templates/bin/_ssh-start.sh.tpl @@ -26,7 +26,15 @@ done IFS='' subnet_address="{{- .Values.network.ssh.from_subnet -}}" + +if [ -z "${subnet_address}" ] ; then + subnet_address="0.0.0.0/0" +fi +listen_interface=$(ip -4 route list ${subnet_address} | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1 +listen_address=$(ip a s $listen_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) + cat > /tmp/sshd_config_extend <