From 35dd187b6f36a5a49b2932b3a3f73ac91b7bfa25 Mon Sep 17 00:00:00 2001 From: Ignacio Dominguez Martinez-Casanueva Date: Wed, 25 Jul 2018 08:16:55 +0200 Subject: [PATCH] Support for custom host mount for contrail-node-init Init container 'contrail-node-init' currently mounts /usr/bin folder. However, some systems such as Fedora Atomic do not allow writing on this directory. This change provides support for setting a custom hostMount path. This way, users can provide a different path that is writable in other systems, like Atomic. Change-Id: If123ffa4a88fdad19356c421a4572b2751c05b51 Closes-Bug: #1781605 (cherry picked from commit be3ce16fbe271ed964d1755806091836ebd0844a) --- contrail-analytics/templates/daemonset-analytics.yaml | 2 +- contrail-analytics/values.yaml | 5 +++++ contrail-controller/templates/daemonset-config.yaml | 2 +- contrail-controller/templates/daemonset-control-only.yaml | 2 +- contrail-controller/templates/daemonset-control.yaml | 2 +- contrail-controller/templates/daemonset-webui.yaml | 2 +- contrail-controller/values.yaml | 5 +++++ .../templates/daemonset-analyticsdb-nodemgr.yaml | 2 +- .../templates/daemonset-configdb-nodemgr.yaml | 2 +- contrail-thirdparty/values.yaml | 5 +++++ contrail-vrouter/templates/daemonset-vrouter-agent-dpdk.yaml | 2 +- .../templates/daemonset-vrouter-agent-kernel.yaml | 2 +- .../templates/daemonset-vrouter-agent-sriov.yaml | 2 +- contrail-vrouter/values.yaml | 5 +++++ 14 files changed, 30 insertions(+), 10 deletions(-) diff --git a/contrail-analytics/templates/daemonset-analytics.yaml b/contrail-analytics/templates/daemonset-analytics.yaml index 719604e..2f47fff 100644 --- a/contrail-analytics/templates/daemonset-analytics.yaml +++ b/contrail-analytics/templates/daemonset-analytics.yaml @@ -177,7 +177,7 @@ spec: path: /var/crashes - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: ssl-dir hostPath: path: /etc/contrail/ssl diff --git a/contrail-analytics/values.yaml b/contrail-analytics/values.yaml index 2e13878..561c879 100644 --- a/contrail-analytics/values.yaml +++ b/contrail-analytics/values.yaml @@ -97,6 +97,11 @@ service: ingress: analytics_api_host: "contrail-analytics-api" +# VolumeMounts related inputs are defined here +volumeMounts: + host_usr_bin: + hostPath: '/usr/bin' + manifests: configmap_analytics_env: true configmap_analytics_keystone: true diff --git a/contrail-controller/templates/daemonset-config.yaml b/contrail-controller/templates/daemonset-config.yaml index 05f3fc8..343f926 100644 --- a/contrail-controller/templates/daemonset-config.yaml +++ b/contrail-controller/templates/daemonset-config.yaml @@ -155,7 +155,7 @@ spec: path: /var/crashes - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: ssl-dir hostPath: path: /etc/contrail/ssl diff --git a/contrail-controller/templates/daemonset-control-only.yaml b/contrail-controller/templates/daemonset-control-only.yaml index 9935136..d3aff86 100644 --- a/contrail-controller/templates/daemonset-control-only.yaml +++ b/contrail-controller/templates/daemonset-control-only.yaml @@ -75,7 +75,7 @@ spec: path: /var/crashes - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: ssl-dir hostPath: path: /etc/contrail/ssl diff --git a/contrail-controller/templates/daemonset-control.yaml b/contrail-controller/templates/daemonset-control.yaml index 7a7b14e..3d2c7f5 100644 --- a/contrail-controller/templates/daemonset-control.yaml +++ b/contrail-controller/templates/daemonset-control.yaml @@ -140,7 +140,7 @@ spec: path: /var/crashes - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: ssl-dir hostPath: path: /etc/contrail/ssl diff --git a/contrail-controller/templates/daemonset-webui.yaml b/contrail-controller/templates/daemonset-webui.yaml index 47b6be8..bf054f2 100644 --- a/contrail-controller/templates/daemonset-webui.yaml +++ b/contrail-controller/templates/daemonset-webui.yaml @@ -103,7 +103,7 @@ spec: path: /var/crashes/contrail/webui - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: ssl-dir hostPath: path: /etc/contrail/ssl diff --git a/contrail-controller/values.yaml b/contrail-controller/values.yaml index cc93271..260ddb7 100644 --- a/contrail-controller/values.yaml +++ b/contrail-controller/values.yaml @@ -208,6 +208,11 @@ ingress: config_api_host: "contrail-config-api" webui_host: "contrail-webui" +# VolumeMounts related inputs are defined here +volumeMounts: + host_usr_bin: + hostPath: '/usr/bin' + manifests: configmap_controller_env: true configmap_controller_keystone: true diff --git a/contrail-thirdparty/templates/daemonset-analyticsdb-nodemgr.yaml b/contrail-thirdparty/templates/daemonset-analyticsdb-nodemgr.yaml index 70dc784..e5ff9e8 100644 --- a/contrail-thirdparty/templates/daemonset-analyticsdb-nodemgr.yaml +++ b/contrail-thirdparty/templates/daemonset-analyticsdb-nodemgr.yaml @@ -88,7 +88,7 @@ spec: path: /var/crashes - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: ssl-dir hostPath: path: /etc/contrail/ssl diff --git a/contrail-thirdparty/templates/daemonset-configdb-nodemgr.yaml b/contrail-thirdparty/templates/daemonset-configdb-nodemgr.yaml index 4434144..600a8bd 100644 --- a/contrail-thirdparty/templates/daemonset-configdb-nodemgr.yaml +++ b/contrail-thirdparty/templates/daemonset-configdb-nodemgr.yaml @@ -88,7 +88,7 @@ spec: path: /var/crashes - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: ssl-dir hostPath: path: /etc/contrail/ssl diff --git a/contrail-thirdparty/values.yaml b/contrail-thirdparty/values.yaml index 3ae234b..dc96649 100644 --- a/contrail-thirdparty/values.yaml +++ b/contrail-thirdparty/values.yaml @@ -128,6 +128,11 @@ pod: min_ready_seconds: 0 max_unavailable: 1 +# VolumeMounts related inputs are defined here +volumeMounts: + host_usr_bin: + hostPath: '/usr/bin' + manifests: configmap_analytics_zookeeper: true configmap_config_zookeeper: true diff --git a/contrail-vrouter/templates/daemonset-vrouter-agent-dpdk.yaml b/contrail-vrouter/templates/daemonset-vrouter-agent-dpdk.yaml index 80ce8a5..0e43c2e 100644 --- a/contrail-vrouter/templates/daemonset-vrouter-agent-dpdk.yaml +++ b/contrail-vrouter/templates/daemonset-vrouter-agent-dpdk.yaml @@ -199,7 +199,7 @@ spec: path: /bin - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: host-dev hostPath: path: /dev diff --git a/contrail-vrouter/templates/daemonset-vrouter-agent-kernel.yaml b/contrail-vrouter/templates/daemonset-vrouter-agent-kernel.yaml index 5b5ecd4..4c9739e 100644 --- a/contrail-vrouter/templates/daemonset-vrouter-agent-kernel.yaml +++ b/contrail-vrouter/templates/daemonset-vrouter-agent-kernel.yaml @@ -185,7 +185,7 @@ spec: path: /var/run/libvirt - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: host-dev-log hostPath: path: /dev/log diff --git a/contrail-vrouter/templates/daemonset-vrouter-agent-sriov.yaml b/contrail-vrouter/templates/daemonset-vrouter-agent-sriov.yaml index 76444ab..9bd10f6 100644 --- a/contrail-vrouter/templates/daemonset-vrouter-agent-sriov.yaml +++ b/contrail-vrouter/templates/daemonset-vrouter-agent-sriov.yaml @@ -255,7 +255,7 @@ spec: path: /var/run/libvirt - name: host-usr-bin hostPath: - path: /usr/bin + path: {{ .Values.volumeMounts.host_usr_bin.hostPath }} - name: host-dev-log hostPath: path: /dev/log diff --git a/contrail-vrouter/values.yaml b/contrail-vrouter/values.yaml index b051b21..fa27d5f 100644 --- a/contrail-vrouter/values.yaml +++ b/contrail-vrouter/values.yaml @@ -119,6 +119,11 @@ pod: min_ready_seconds: 0 max_unavailable: 1 +# VolumeMounts related inputs are defined here +volumeMounts: + host_usr_bin: + hostPath: '/usr/bin' + manifests: configmap_vrouter_kernel: true configmap_vrouter_keystone: true