From e0f076b65840e52ae6720cf0ae4b3be838e807dd Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Sat, 16 Jun 2018 14:09:32 -0500 Subject: [PATCH] Neutron: Ensure agent processes are reaped This PS moves the neutron agents to run as child processes of either the pause container or use the hosts init system (for k8s <1.10) to prevent defunct process sprawl. Change-Id: I3392bdc957144c1aa83314583d57183d35279336 Co-Authored-By: Hyunsun Moon Signed-off-by: Pete Birley --- neutron/templates/daemonset-dhcp-agent.yaml | 5 +++++ neutron/templates/daemonset-l3-agent.yaml | 5 +++++ neutron/templates/daemonset-lb-agent.yaml | 5 +++++ neutron/templates/daemonset-metadata-agent.yaml | 5 +++++ neutron/templates/daemonset-ovs-agent.yaml | 5 +++++ neutron/templates/daemonset-sriov-agent.yaml | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/neutron/templates/daemonset-dhcp-agent.yaml b/neutron/templates/daemonset-dhcp-agent.yaml index 91688f79d7..fee57fcf88 100644 --- a/neutron/templates/daemonset-dhcp-agent.yaml +++ b/neutron/templates/daemonset-dhcp-agent.yaml @@ -49,6 +49,11 @@ spec: {{ .Values.labels.agent.dhcp.node_selector_key }}: {{ .Values.labels.agent.dhcp.node_selector_value }} dnsPolicy: ClusterFirstWithHostNet hostNetwork: true + {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }} + shareProcessNamespace: true + {{- else }} + hostPID: true + {{- end }} initContainers: {{ tuple $envAll "pod_dependency" $mounts_neutron_dhcp_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/neutron/templates/daemonset-l3-agent.yaml b/neutron/templates/daemonset-l3-agent.yaml index 60647023a0..49f6341588 100644 --- a/neutron/templates/daemonset-l3-agent.yaml +++ b/neutron/templates/daemonset-l3-agent.yaml @@ -49,6 +49,11 @@ spec: {{ .Values.labels.agent.l3.node_selector_key }}: {{ .Values.labels.agent.l3.node_selector_value }} dnsPolicy: ClusterFirstWithHostNet hostNetwork: true + {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }} + shareProcessNamespace: true + {{- else }} + hostPID: true + {{- end }} initContainers: {{ tuple $envAll "pod_dependency" $mounts_neutron_l3_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: diff --git a/neutron/templates/daemonset-lb-agent.yaml b/neutron/templates/daemonset-lb-agent.yaml index 91572cc61b..e90c0f0f47 100644 --- a/neutron/templates/daemonset-lb-agent.yaml +++ b/neutron/templates/daemonset-lb-agent.yaml @@ -49,6 +49,11 @@ spec: {{ .Values.labels.lb.node_selector_key }}: {{ .Values.labels.lb.node_selector_value }} dnsPolicy: ClusterFirstWithHostNet hostNetwork: true + {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }} + shareProcessNamespace: true + {{- else }} + hostPID: true + {{- end }} initContainers: {{ tuple $envAll "pod_dependency" $mounts_neutron_lb_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: neutron-lb-agent-kernel-modules diff --git a/neutron/templates/daemonset-metadata-agent.yaml b/neutron/templates/daemonset-metadata-agent.yaml index 779ff8522b..c1c8d52dbb 100644 --- a/neutron/templates/daemonset-metadata-agent.yaml +++ b/neutron/templates/daemonset-metadata-agent.yaml @@ -49,6 +49,11 @@ spec: {{ .Values.labels.agent.metadata.node_selector_key }}: {{ .Values.labels.agent.metadata.node_selector_value }} dnsPolicy: ClusterFirstWithHostNet hostNetwork: true + {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }} + shareProcessNamespace: true + {{- else }} + hostPID: true + {{- end }} initContainers: {{ tuple $envAll "pod_dependency" $mounts_neutron_metadata_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: neutron-metadata-agent-init diff --git a/neutron/templates/daemonset-ovs-agent.yaml b/neutron/templates/daemonset-ovs-agent.yaml index 884540ea07..7b1a801f63 100644 --- a/neutron/templates/daemonset-ovs-agent.yaml +++ b/neutron/templates/daemonset-ovs-agent.yaml @@ -49,6 +49,11 @@ spec: {{ .Values.labels.ovs.node_selector_key }}: {{ .Values.labels.ovs.node_selector_value }} dnsPolicy: ClusterFirstWithHostNet hostNetwork: true + {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }} + shareProcessNamespace: true + {{- else }} + hostPID: true + {{- end }} initContainers: {{ tuple $envAll "pod_dependency" $mounts_neutron_ovs_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: neutron-openvswitch-agent-kernel-modules diff --git a/neutron/templates/daemonset-sriov-agent.yaml b/neutron/templates/daemonset-sriov-agent.yaml index 706fc76f8a..c1675c8951 100644 --- a/neutron/templates/daemonset-sriov-agent.yaml +++ b/neutron/templates/daemonset-sriov-agent.yaml @@ -49,6 +49,11 @@ spec: {{ .Values.labels.sriov.node_selector_key }}: {{ .Values.labels.sriov.node_selector_value }} dnsPolicy: ClusterFirstWithHostNet hostNetwork: true + {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }} + shareProcessNamespace: true + {{- else }} + hostPID: true + {{- end }} initContainers: {{ tuple $envAll "pod_dependency" $mounts_neutron_sriov_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: neutron-sriov-agent-init