From d47bca028d5575eff84bc4a7394ffe003fdb43ff Mon Sep 17 00:00:00 2001 From: Yingrong Zhao <22300958+VinozzZ@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:53:53 -0400 Subject: [PATCH] feat(refinery): Set ShutdownDelay based on terminationGracePeriodSeconds (#382) ## Which problem is this PR solving? Refinery 2.8 attempts to drain data to remaining peers on shutdown, and has a configurable ShutdownDelay field where it tries to process remaining work while shutting down. In k8s we need this config option to be inline with terminationGracePeriodSeconds to ensure k8s doesn't kill pods early. it's the same change as #360 ## Short description of the changes - added terminationGracePeriodSeconds configuration option in values.yaml - set ShutdownDelay to be terminationGracePeriodSeconds - 5 seconds by default. Users can override this value in their values.yaml - publish a `-hnyinternal` tag for the change ## How to verify that this has the expected result Test localling using kind --- charts/refinery/Chart.yaml | 4 ++-- charts/refinery/templates/deployment.yaml | 1 + charts/refinery/values.yaml | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/refinery/Chart.yaml b/charts/refinery/Chart.yaml index 4a0b62c..26f05a6 100644 --- a/charts/refinery/Chart.yaml +++ b/charts/refinery/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: refinery description: Chart to deploy Honeycomb Refinery type: application -version: 2.11.1 -appVersion: 2.7.1 +version: 2.11.2-hnyinternal.0 +appVersion: 2.8.0-dev.0 keywords: - refinery - honeycomb diff --git a/charts/refinery/templates/deployment.yaml b/charts/refinery/templates/deployment.yaml index 0c5edc2..4dfb226 100644 --- a/charts/refinery/templates/deployment.yaml +++ b/charts/refinery/templates/deployment.yaml @@ -49,6 +49,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} spec: + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/charts/refinery/values.yaml b/charts/refinery/values.yaml index c97903e..f8aaad8 100644 --- a/charts/refinery/values.yaml +++ b/charts/refinery/values.yaml @@ -24,6 +24,7 @@ config: Host: '{{include "refinery.redis.fullname" .}}:6379' Collection: + ShutdownDelay: '{{ sub .Values.terminationGracePeriodSeconds 5 }}s' # AvailableMemory is the amount of system memory available to the Refinery process. AvailableMemory: '{{ .Values.resources.limits.memory }}' MaxMemoryPercentage: 75 @@ -319,6 +320,8 @@ tolerations: [] affinity: {} +terminationGracePeriodSeconds: 35 + # PodDisruptionBudget: # # Limit the number of concurrent disruptions that your application experiences, allowing for higher availability while