Skip to content

Commit

Permalink
feat: Support pod terminationGracePeriodSeconds (#182)
Browse files Browse the repository at this point in the history
* support configurable termination grace period

* Add to test deployment
  • Loading branch information
jsirianni authored Dec 12, 2024
1 parent 7028175 commit 8650a93
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 4 deletions.
6 changes: 6 additions & 0 deletions charts/bindplane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,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. |
Expand Down
2 changes: 1 addition & 1 deletion charts/bindplane/templates/bindplane-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/bindplane/templates/bindplane-nats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ spec:
preStop:
exec:
command: ["sh", "-c", "sleep 5",]
terminationGracePeriodSeconds: 60
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds.nats }}
volumes:
- name: data
emptyDir: {}
Expand Down
2 changes: 1 addition & 1 deletion charts/bindplane/templates/bindplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,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 }}
Expand Down
1 change: 1 addition & 0 deletions charts/bindplane/templates/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ spec:
- mountPath: /etc/prometheus/web.yml
subPath: web.yml
name: config
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds.prometheus }}
volumes:
- name: config
configMap:
Expand Down
2 changes: 1 addition & 1 deletion charts/bindplane/templates/transform-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ spec:
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: 60
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds.transform_agent }}
14 changes: 14 additions & 0 deletions charts/bindplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,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.
Expand Down
7 changes: 7 additions & 0 deletions test/cases/all/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,10 @@ priorityClassName:
jobs: "high-priority"
prometheus: "high-priority"
transform_agent: "high-priority"

terminationGracePeriodSeconds:
bindplane: 30
nats: 31
jobs: 32
prometheus: 33
transform_agent: 34

0 comments on commit 8650a93

Please sign in to comment.