diff --git a/haproxy-ingress/README.md b/haproxy-ingress/README.md index be72e96..9c814ff 100644 --- a/haproxy-ingress/README.md +++ b/haproxy-ingress/README.md @@ -259,6 +259,7 @@ Parameter | Description | Default `controller.logs.port` | port used by sidecar logs container | `514` `controller.logs.probes` | enable tcp based liveness and readiness probes in the log container | `false` `controller.logs.securityContext` | Security context settings for sidecar logs container | `{}` +`controller.logs.lifecycle` | Lifecycle hooks for sidecar logs container | `{}` `controller.logs.resources` | access-logs container resource requests & limits | `{}` `defaultBackend.enabled` | whether to use the default backend component | `false` `defaultBackend.name` | name of the default backend component | `default-backend` diff --git a/haproxy-ingress/templates/_podtemplate.yaml b/haproxy-ingress/templates/_podtemplate.yaml index 2355505..28a8011 100644 --- a/haproxy-ingress/templates/_podtemplate.yaml +++ b/haproxy-ingress/templates/_podtemplate.yaml @@ -219,6 +219,10 @@ spec: securityContext: {{- toYaml .Values.controller.logs.securityContext | nindent 8 }} {{- end }} +{{- if .Values.controller.logs.lifecycle }} + lifecycle: + {{- toYaml .Values.controller.logs.lifecycle | nindent 8 }} +{{- end }} {{- end }} {{- if and .Values.controller.stats.enabled .Values.controller.metrics.enabled (not .Values.controller.metrics.embedded) }} - name: prometheus-exporter diff --git a/haproxy-ingress/values.yaml b/haproxy-ingress/values.yaml index 2841fd9..6511fc6 100644 --- a/haproxy-ingress/values.yaml +++ b/haproxy-ingress/values.yaml @@ -612,7 +612,8 @@ controller: ## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ ## securityContext: {} - + # If lifecycle is added to the haproxy container, it can be useful to also configure it here to ensure the syslog container is not killed before haproxy when the pod is terminating, allowing it to flush the logs properly. + lifecycle: {} # port used by syslog container port: 514