From 69196031cde40f13a64c8d61f51c2aaf515b85a9 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Fri, 2 Nov 2018 08:12:24 -0500 Subject: [PATCH] Nagios: Ensure processes are reaped This moves Nagios 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: I6a93d446577674b0b012f9567d5e6a5794ebc44b --- nagios/templates/deployment.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nagios/templates/deployment.yaml b/nagios/templates/deployment.yaml index a8dbc626d..8650bf45b 100644 --- a/nagios/templates/deployment.yaml +++ b/nagios/templates/deployment.yaml @@ -85,6 +85,11 @@ spec: nodeSelector: {{ .Values.labels.nagios.node_selector_key }}: {{ .Values.labels.nagios.node_selector_value | quote }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.nagios.timeout | default "30" }} + {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }} + shareProcessNamespace: true + {{- else }} + hostPID: true + {{- end }} initContainers: {{ tuple $envAll "nagios" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: nagios-log-ownership