From 064a125e4a89dc1b3ec11c252b138eadbc020527 Mon Sep 17 00:00:00 2001 From: Fabio Date: Fri, 4 Aug 2023 10:33:48 -0300 Subject: [PATCH] Add feature to auto restart nginx periodically --- charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml | 8 ++++++++ charts/mailproxy/v0.1.0/values.yaml | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml b/charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml index 5dcbe2b..eec5c38 100644 --- a/charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml +++ b/charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml @@ -26,6 +26,14 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + args: + - timeout + - --preserve-status + - --foreground + - {{ .Values.nginx.restartEvery }} + - /usr/sbin/nginx + - -g + - daemon off; securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag | default .Chart.AppVersion }}" diff --git a/charts/mailproxy/v0.1.0/values.yaml b/charts/mailproxy/v0.1.0/values.yaml index be9c38a..c7b9840 100644 --- a/charts/mailproxy/v0.1.0/values.yaml +++ b/charts/mailproxy/v0.1.0/values.yaml @@ -26,6 +26,10 @@ nginx: annotations: {} loadBalancerIP: "" noAuthSmtpServerIP: "" + # Restart container to reload periodically. A number with a suffix: + # 's' for seconds (default) , 'm' for minutes, 'h' for hours or 'd' for days. + # Specifying 0 disables the timeout. + restartEvery: 30d certificate: issuer: letsencrypt-staging issuerKind: ClusterIssuer