From 08e8c5859d21cd76feeba0474a545c35680b163e Mon Sep 17 00:00:00 2001 From: Ahmad Karimi <39967326+therealak12@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:56:08 +0330 Subject: [PATCH] [bitnami/contour] allow customizing lifecycle hooks for envoy containers (#27506) * allow customizing lifecycle hooks for envoy containers Signed-off-by: Ahmad Karimi * Update CHANGELOG.md Signed-off-by: Bitnami Containers --------- Signed-off-by: Ahmad Karimi Signed-off-by: Bitnami Containers Co-authored-by: Bitnami Containers --- bitnami/contour/CHANGELOG.md | 8 ++++++-- bitnami/contour/Chart.yaml | 2 +- bitnami/contour/README.md | 1 + bitnami/contour/templates/envoy/deployment.yaml | 8 ++++++++ bitnami/contour/values.yaml | 2 ++ 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bitnami/contour/CHANGELOG.md b/bitnami/contour/CHANGELOG.md index 7be71cce28..06a176a749 100644 --- a/bitnami/contour/CHANGELOG.md +++ b/bitnami/contour/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog -## 18.2.6 (2024-06-18) +## 18.2.7 (2024-06-27) -* [bitnami/contour] Release 18.2.6 ([#27335](https://github.com/bitnami/charts/pull/27335)) +* [bitnami/contour] allow customizing lifecycle hooks for envoy containers ([#27506](https://github.com/bitnami/charts/pull/27506)) + +## 18.2.6 (2024-06-18) + +* [bitnami/contour] Release 18.2.6 (#27335) ([c28d442](https://github.com/bitnami/charts/commit/c28d442b0762f714a6279ff1bf204eac218105fc)), closes [#27335](https://github.com/bitnami/charts/issues/27335) ## 18.2.5 (2024-06-17) diff --git a/bitnami/contour/Chart.yaml b/bitnami/contour/Chart.yaml index 7b6589673d..98130effaf 100644 --- a/bitnami/contour/Chart.yaml +++ b/bitnami/contour/Chart.yaml @@ -32,4 +32,4 @@ maintainers: name: contour sources: - https://github.com/bitnami/charts/tree/main/bitnami/contour -version: 18.2.6 +version: 18.2.7 diff --git a/bitnami/contour/README.md b/bitnami/contour/README.md index 88939a1bf5..cee0245de2 100644 --- a/bitnami/contour/README.md +++ b/bitnami/contour/README.md @@ -353,6 +353,7 @@ As an alternative, you can use of the preset configurations for pod affinity, po | `envoy.shutdownManager.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if envoy.shutdownManager.resources is set (envoy.shutdownManager.resources is recommended for production). | `nano` | | `envoy.shutdownManager.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` | | `envoy.shutdownManager.containerPorts.http` | Specify Port for shutdown container | `8090` | +| `envoy.shutdownManager.lifecycleHooks` | lifecycleHooks for the container to automate configuration before or after startup. | `{}` | | `envoy.shutdownManager.containerSecurityContext.enabled` | Enabled envoy shutdownManager containers' Security Context | `true` | | `envoy.shutdownManager.containerSecurityContext.seLinuxOptions` | Set SELinux options in container | `{}` | | `envoy.shutdownManager.containerSecurityContext.runAsUser` | Set envoy shutdownManager containers' Security Context runAsUser | `1001` | diff --git a/bitnami/contour/templates/envoy/deployment.yaml b/bitnami/contour/templates/envoy/deployment.yaml index 046f16a28d..e4b24c640d 100644 --- a/bitnami/contour/templates/envoy/deployment.yaml +++ b/bitnami/contour/templates/envoy/deployment.yaml @@ -146,6 +146,9 @@ spec: successThreshold: {{ .Values.envoy.shutdownManager.readinessProbe.successThreshold }} failureThreshold: {{ .Values.envoy.shutdownManager.readinessProbe.failureThreshold }} {{- end }} + {{- if .Values.envoy.shutdownManager.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.envoy.shutdownManager.lifecycleHooks "context" $) | nindent 12 }} + {{- else }} lifecycle: preStop: exec: @@ -153,6 +156,7 @@ spec: - contour - envoy - shutdown + {{- end }} name: shutdown-manager {{- if .Values.envoy.shutdownManager.resources }} resources: {{- toYaml .Values.envoy.shutdownManager.resources | nindent 12 }} @@ -303,6 +307,9 @@ spec: {{- if .Values.envoy.extraVolumeMounts }} {{- include "common.tplvalues.render" ( dict "value" .Values.envoy.extraVolumeMounts "context" $ ) | nindent 12 }} {{- end }} + {{- if .Values.envoy.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.envoy.lifecycleHooks "context" $) | nindent 12 }} + {{- else }} lifecycle: preStop: {{- if .Values.envoy.shutdownManager.enabled }} @@ -317,6 +324,7 @@ spec: - '-c' - sleep {{ .Values.envoy.terminationGracePeriodSeconds }}; kill 1 {{- end }} + {{- end }} {{- if .Values.envoy.sidecars }} {{- include "common.tplvalues.render" ( dict "value" .Values.envoy.sidecars "context" $ ) | nindent 8 }} {{- end }} diff --git a/bitnami/contour/values.yaml b/bitnami/contour/values.yaml index 410cdfec79..1b258c4812 100644 --- a/bitnami/contour/values.yaml +++ b/bitnami/contour/values.yaml @@ -733,8 +733,10 @@ envoy: ## More information: https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15 ## @param envoy.shutdownManager.resources Set container requests and limits for different resources like CPU or memory (essential for production workloads) ## @param envoy.shutdownManager.containerPorts.http Specify Port for shutdown container + ## @param envoy.shutdownManager.lifecycleHooks lifecycleHooks for the container to automate configuration before or after startup. ## shutdownManager: + lifecycleHooks: {} extraArgs: [] enabled: true resourcesPreset: "nano"