Skip to content

Commit

Permalink
Configurable lifecycle hooks for controller container (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmoraisjr committed Jul 9, 2021
1 parent d51eea3 commit 12f8d73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions haproxy-ingress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,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): `<port>: <namespace>/<servicename>:<portnumber>[:[<in-proxy>][:<out-proxy>]]` | `{}`
`controller.enableStaticPorts` | Set to `false` to only rely on ports from `controller.tcp` | `true`
Expand Down
4 changes: 4 additions & 0 deletions haproxy-ingress/templates/_podtemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,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 }}"
Expand Down
6 changes: 6 additions & 0 deletions haproxy-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,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
Expand Down

0 comments on commit 12f8d73

Please sign in to comment.