From 52f8415deb7b256bd618087cade43039c852d715 Mon Sep 17 00:00:00 2001 From: Gerry Kopec Date: Tue, 9 Apr 2019 21:18:35 -0400 Subject: [PATCH] Start nova sshd container only if enabled Only start the sshd container of nova-compute pod if the capability is enabled. Defaults to off to allow cases where nova docker image does not have ssh packages to run cleanly. Story: 2003463 Task: 30441 Change-Id: I3acf5b654ecda23a93f6c28e865e1bbee14370aa Signed-off-by: Gerry Kopec --- nova/templates/bin/_ssh-start.sh.tpl | 2 -- nova/templates/daemonset-compute.yaml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/templates/bin/_ssh-start.sh.tpl b/nova/templates/bin/_ssh-start.sh.tpl index 158090b0ac..386a8c3caa 100644 --- a/nova/templates/bin/_ssh-start.sh.tpl +++ b/nova/templates/bin/_ssh-start.sh.tpl @@ -33,7 +33,6 @@ if [[ $(stat -c %U:%G ~nova/.ssh) != "nova:nova" ]]; then chown nova: ~nova/.ssh fi -{{- if .Values.network.sshd.enabled }} subnet_address="{{- .Values.network.sshd.from_subnet -}}" cat > /tmp/sshd_config_extend <> /etc/ssh/sshd_config rm /tmp/sshd_config_extend -{{- end }} exec /usr/sbin/sshd -D -e -o Port=$SSH_PORT diff --git a/nova/templates/daemonset-compute.yaml b/nova/templates/daemonset-compute.yaml index 4a7b90b58c..43ca19775d 100644 --- a/nova/templates/daemonset-compute.yaml +++ b/nova/templates/daemonset-compute.yaml @@ -298,6 +298,7 @@ spec: mountPath: /etc/machine-id readOnly: true {{ if $mounts_nova_compute.volumeMounts }}{{ toYaml $mounts_nova_compute.volumeMounts | indent 12 }}{{ end }} + {{- if .Values.network.sshd.enabled }} - name: nova-compute-ssh {{ tuple $envAll "nova_compute_ssh" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.ssh | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} @@ -327,6 +328,7 @@ spec: mountPath: /tmp/ssh-start.sh subPath: ssh-start.sh readOnly: true + {{ end }} volumes: - name: nova-bin configMap: