From 3155a5465ef4e84b98fd42c809bba07d8e294884 Mon Sep 17 00:00:00 2001 From: Joe Sirianni Date: Wed, 20 Nov 2024 15:54:56 -0500 Subject: [PATCH] support configurable termination grace period --- charts/bindplane/Chart.yaml | 2 +- charts/bindplane/README.md | 8 +++++++- charts/bindplane/templates/bindplane-jobs.yaml | 2 +- charts/bindplane/templates/bindplane-nats.yaml | 2 +- charts/bindplane/templates/bindplane.yaml | 2 +- charts/bindplane/templates/prometheus.yaml | 1 + charts/bindplane/templates/transform-agent.yaml | 2 +- charts/bindplane/values.yaml | 14 ++++++++++++++ 8 files changed, 27 insertions(+), 6 deletions(-) diff --git a/charts/bindplane/Chart.yaml b/charts/bindplane/Chart.yaml index e022ae7..b7e6be4 100644 --- a/charts/bindplane/Chart.yaml +++ b/charts/bindplane/Chart.yaml @@ -3,7 +3,7 @@ name: bindplane description: BindPlane OP is an observability pipeline. type: application # The chart's version -version: 1.20.9 +version: 1.20.10 # The BindPlane OP tagged release. If the user does not # set the `image.tag` values option, this version is used. appVersion: 1.82.0 diff --git a/charts/bindplane/README.md b/charts/bindplane/README.md index 2f7343d..226f9e1 100644 --- a/charts/bindplane/README.md +++ b/charts/bindplane/README.md @@ -1,6 +1,6 @@ # bindplane -![Version: 1.20.9](https://img.shields.io/badge/Version-1.20.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.82.0](https://img.shields.io/badge/AppVersion-1.82.0-informational?style=flat-square) +![Version: 1.20.10](https://img.shields.io/badge/Version-1.20.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.82.0](https://img.shields.io/badge/AppVersion-1.82.0-informational?style=flat-square) BindPlane OP is an observability pipeline. @@ -160,6 +160,12 @@ BindPlane OP is an observability pipeline. | resources.requests.cpu | string | `"1000m"` | CPU request. | | resources.requests.memory | string | `"1000Mi"` | Memory request. | | service.annotations | object | `{}` | Custom annotations which will be added to the service object. Useful for specifying things such as `cloud.google.com/backend-config`. | +| terminationGracePeriodSeconds | object | `{"bindplane":60,"jobs":60,"nats":60,"prometheus":60,"transform_agent":60}` | Configure the terminationGracePeriodSeconds for BindPlane, BindPlane NATS, BindPlane Jobs, and BindPlane Prometheus pods. | +| terminationGracePeriodSeconds.bindplane | int | `60` | This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane deployment pods. | +| terminationGracePeriodSeconds.jobs | int | `60` | This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane Jobs pod. | +| terminationGracePeriodSeconds.nats | int | `60` | This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane NATS statefulset or deployment pods, if NATS is enabled. | +| terminationGracePeriodSeconds.prometheus | int | `60` | This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane Prometheus pod. | +| terminationGracePeriodSeconds.transform_agent | int | `60` | This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane transform agent pod. | | tolerations | object | `{}` | The Pod's tolerations | | topologySpreadConstraints.bindplane | list | `[]` | spec.template.spec.topologySpreadConstraints on the BindPlane deployment pods. | | topologySpreadConstraints.jobs | list | `[]` | This is for configuring spec.template.spec.topologySpreadConstraints on the BindPlane Jobs pod. | diff --git a/charts/bindplane/templates/bindplane-jobs.yaml b/charts/bindplane/templates/bindplane-jobs.yaml index 5041dfd..4080006 100644 --- a/charts/bindplane/templates/bindplane-jobs.yaml +++ b/charts/bindplane/templates/bindplane-jobs.yaml @@ -556,7 +556,7 @@ spec: preStop: exec: command: ["sh", "-c", "sleep 5",] - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds.jobs }} volumes: {{- if eq .Values.eventbus.type "pubsub" }} {{- if .Values.eventbus.pubsub.credentials.secret }} diff --git a/charts/bindplane/templates/bindplane-nats.yaml b/charts/bindplane/templates/bindplane-nats.yaml index f3970a8..e27c192 100644 --- a/charts/bindplane/templates/bindplane-nats.yaml +++ b/charts/bindplane/templates/bindplane-nats.yaml @@ -421,7 +421,7 @@ spec: preStop: exec: command: ["sh", "-c", "sleep 5",] - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds.nats }} volumes: - name: data emptyDir: {} diff --git a/charts/bindplane/templates/bindplane.yaml b/charts/bindplane/templates/bindplane.yaml index 1b3da6e..906205f 100644 --- a/charts/bindplane/templates/bindplane.yaml +++ b/charts/bindplane/templates/bindplane.yaml @@ -611,7 +611,7 @@ spec: name: {{ include "bindplane.fullname" . }}-prometheus-data {{- end }} {{- end }} - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds.bindplane }} volumes: {{- if eq .Values.eventbus.type "pubsub" }} {{- if .Values.eventbus.pubsub.credentials.secret }} diff --git a/charts/bindplane/templates/prometheus.yaml b/charts/bindplane/templates/prometheus.yaml index fcd6956..785cefe 100644 --- a/charts/bindplane/templates/prometheus.yaml +++ b/charts/bindplane/templates/prometheus.yaml @@ -119,6 +119,7 @@ spec: - mountPath: /etc/prometheus/web.yml subPath: web.yml name: config + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds.prometheus }} volumes: - name: config configMap: diff --git a/charts/bindplane/templates/transform-agent.yaml b/charts/bindplane/templates/transform-agent.yaml index a90bbc4..7ab13b4 100644 --- a/charts/bindplane/templates/transform-agent.yaml +++ b/charts/bindplane/templates/transform-agent.yaml @@ -74,4 +74,4 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds.transform_agent }} diff --git a/charts/bindplane/values.yaml b/charts/bindplane/values.yaml index 1b519ae..74b7e7c 100644 --- a/charts/bindplane/values.yaml +++ b/charts/bindplane/values.yaml @@ -445,6 +445,20 @@ priorityClassName: # -- This is for configuring spec.template.spec.priorityClassName on the BindPlane transform agent pod. transform_agent: "" +# -- Configure the terminationGracePeriodSeconds for BindPlane, BindPlane NATS, BindPlane Jobs, and BindPlane Prometheus pods. +terminationGracePeriodSeconds: + # -- This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane deployment pods. + bindplane: 60 + # -- This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane NATS statefulset or deployment + # pods, if NATS is enabled. + nats: 60 + # -- This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane Jobs pod. + jobs: 60 + # -- This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane Prometheus pod. + prometheus: 60 + # -- This is for configuring spec.template.spec.terminationGracePeriodSeconds on the BindPlane transform agent pod. + transform_agent: 60 + # -- Configure the nodeSelector for BindPlane, BindPlane NATS, BindPlane Jobs, and BindPlane Prometheus pods. nodeSelector: # -- This is for configuring spec.template.spec.nodeSelector on the BindPlane deployment pod when using the bbolt backend.