diff --git a/haproxy-ingress/README.md b/haproxy-ingress/README.md index ce89f61..61d3a7a 100755 --- a/haproxy-ingress/README.md +++ b/haproxy-ingress/README.md @@ -105,6 +105,7 @@ Parameter | Description | Default `controller.hostNetwork` | Optionally set to true when using CNI based kubernetes installations | `false` `controller.dnsPolicy` | Optionally change this to ClusterFirstWithHostNet in case you have 'hostNetwork: true' | `ClusterFirst` `controller.terminationGracePeriodSeconds` | How much to wait before terminating a pod (in seconds) | `60` +`controller.lifecycle` | Lifecycle hooks for controller container | `{}` `controller.kind` | Type of deployment, DaemonSet or Deployment | `Deployment` `controller.tcp` | TCP [service ConfigMap](https://haproxy-ingress.github.io/docs/configuration/command-line/#tcp-services-configmap): `: /:[:[][:]]` | `{}` `controller.enableStaticPorts` | Set to `false` to only rely on ports from `controller.tcp` | `true` diff --git a/haproxy-ingress/templates/_podtemplate.yaml b/haproxy-ingress/templates/_podtemplate.yaml index 2a4bcd2..8fc8d37 100644 --- a/haproxy-ingress/templates/_podtemplate.yaml +++ b/haproxy-ingress/templates/_podtemplate.yaml @@ -129,6 +129,10 @@ spec: {{- end }} resources: {{- toYaml .Values.controller.resources | nindent 8 }} +{{- if .Values.controller.lifecycle }} + lifecycle: + {{- toYaml .Values.controller.lifecycle | nindent 8 }} +{{- end }} {{- if .Values.controller.logs.enabled }} - name: access-logs image: "{{ .Values.controller.logs.image.repository }}:{{ .Values.controller.logs.image.tag }}" diff --git a/haproxy-ingress/values.yaml b/haproxy-ingress/values.yaml index 799327b..c615cef 100644 --- a/haproxy-ingress/values.yaml +++ b/haproxy-ingress/values.yaml @@ -123,6 +123,12 @@ controller: # How many seconds to wait before terminating a pod. terminationGracePeriodSeconds: 60 + # Configure container lifecycle. When scaling replicas down this can be + # used to prevent controller container from terminating quickly and drop in-flight requests. + # For example, when the controller runs behind Network Load Balancer this can be used + # to configure preStop hook to sleep along with deregistration_delay. + lifecycle: {} + ## DaemonSet or Deployment ## kind: Deployment