diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d2aa56a90e47e00fd33be2b659a5ceb38e5cf4d..381589a7134f54ddd0c7abfeec245ce713b9308f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.2.0] - 2021-12-23 + +### Added + +- \[Chart\] Allow configuring timeouts per linkup and per port mapping + ## [2.1.3] - 2021-12-21 ### Changed @@ -58,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release +[2.2.0]: https://edugit.org/AlekSIS/libs/k8s-linkup/-/tags/2.2.0 [2.1.3]: https://edugit.org/AlekSIS/libs/k8s-linkup/-/tags/2.1.3 [2.1.2]: https://edugit.org/AlekSIS/libs/k8s-linkup/-/tags/2.1.2 [2.1.1]: https://edugit.org/AlekSIS/libs/k8s-linkup/-/tags/2.1.1 diff --git a/charts/k8s-linkup/templates/configmap.yaml b/charts/k8s-linkup/templates/configmap.yaml index 4a3e2ca2fcca2468a3025a574098deee3f902b82..c9f6850ea283e1fe17eb391f5826679be6bdcc05 100644 --- a/charts/k8s-linkup/templates/configmap.yaml +++ b/charts/k8s-linkup/templates/configmap.yaml @@ -1,4 +1,5 @@ {{- range .Values.linkups }} +{{- $timeouts := .timeouts | default dict }} apiVersion: v1 kind: ConfigMap metadata: @@ -11,9 +12,9 @@ data: log stdout format raw local0 notice defaults - timeout connect 10s - timeout client 30s - timeout server 30s + timeout connect {{ $timeouts.connect | default $.Values.timeouts.connect }} + timeout client {{ $timeouts.client | default $.Values.timeouts.client }} + timeout server {{ $timeouts.server | default $.Values.timeouts.server | default $timeouts.client | default $.Values.timeouts.client }} log global mode tcp @@ -27,22 +28,26 @@ data: monitor-uri /health {{- range .portMappings }} {{- if ( .monitored | default true ) }} - acl {{ .name }}_down nbsrv({{ .name}}_back) lt 1 + acl {{ .name }}_down nbsrv({{ .name}}) lt 1 monitor fail if {{ .name }}_down {{- end }} {{- end }} {{- range .portMappings }} {{- $local := .local | default dict }} - frontend {{ .name }} + {{- $timeoutshere := .timeouts | default dict }} + listen {{ .name }} bind *:{{ $local.port | default .remote.port }} maxconn {{ .maxconn | default 20 }} - default_backend {{ .name }}_back - {{- end }} - - {{- range .portMappings }} - backend {{ .name }}_back - balance roundrobin + {{- if $timeoutshere.connect }} + timeout connect {{ $timeoutshere.connect }} + {{- end }} + {{- if $timeoutshere.client }} + timeout client {{ $timeoutshere.client }} + {{- end }} + {{- if or $timeoutshere.server $timeoutshere.client }} + timeout server {{ $timeoutshere.server | default $timeoutshere.client }} + {{- end }} server {{ .remote.host | replace "." "_" }}_{{ .remote.port }} {{ .remote.host }}:{{ .remote.port }} {{- if ( .monitored | default true ) }} check{{- end}} {{- end }} --- diff --git a/charts/k8s-linkup/values.yaml b/charts/k8s-linkup/values.yaml index 1d73d40638eec7ee3b86bb4f93e125cf8160eead..001d51f5f4dcdda345947d89ca238d3775f99540 100644 --- a/charts/k8s-linkup/values.yaml +++ b/charts/k8s-linkup/values.yaml @@ -10,6 +10,11 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "" +timeouts: + connect: 4s + client: 31s +# server: 31s + linkups: [] # - name: linkup1 # connection: openvpn @@ -21,6 +26,8 @@ linkups: [] # secret: # name: openvpn-secret # healthCheckPort: 9000 +# timeouts: +# connect: 7s # portMappings: # - name: ldap # local: @@ -30,6 +37,8 @@ linkups: [] # port: 389 # maxconn: 20 # type: TCP +# timeouts: +# data: 601s # monitored: true imagePullSecrets: []