Skip to content

Commit 168ee9c

Browse files
fix(chart): use native stop signal when supported
1 parent e85b0c2 commit 168ee9c

5 files changed

Lines changed: 25 additions & 3 deletions

File tree

‎charts/abstract-node/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: abstract-node
33
description: External node for syncing and serving blockchain data for Abstract
4-
version: 0.1.41
4+
version: 0.1.42
55
type: application
66
icon: https://abstract-assets.abs.xyz/icons/light.png
77
keywords:

‎charts/abstract-node/templates/_helpers.tpl‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ Render external node command / args, preserving the existing shutdown wrapper be
104104
{{- define "abstract-node.nodeArgs" -}}
105105
{{- $root := .root -}}
106106
{{- $args := default (list) .args -}}
107-
{{- if $root.Values.shutdownWrapper.enabled }}
107+
{{- $kubeVersion := $root.Capabilities.KubeVersion.Version | trimPrefix "v" -}}
108+
{{- $supportsStopSignal := semverCompare ">=1.33.0-0" $kubeVersion -}}
109+
{{- if and $root.Values.shutdownWrapper.enabled (not $supportsStopSignal) }}
108110
command:
109111
- /bin/sh
110112
- -ec

‎charts/abstract-node/templates/deployment-api.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{{- if .Values.ha.enabled }}
2+
{{- $kubeVersion := .Capabilities.KubeVersion.Version | trimPrefix "v" -}}
3+
{{- $supportsStopSignal := semverCompare ">=1.33.0-0" $kubeVersion -}}
24
---
35
apiVersion: apps/v1
46
kind: Deployment
@@ -45,13 +47,21 @@ spec:
4547
{{- end }}
4648
{{- if .Values.terminationGracePeriodSeconds }}
4749
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
50+
{{- end }}
51+
{{- if $supportsStopSignal }}
52+
os:
53+
name: linux
4854
{{- end }}
4955
serviceAccountName: {{ include "common.names.serviceAccountName" . }}
5056
priorityClassName: {{ .Values.priorityClassName | quote }}
5157
containers:
5258
- name: {{ .Chart.Name }}
5359
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
5460
imagePullPolicy: {{ .Values.image.pullPolicy }}
61+
{{- if $supportsStopSignal }}
62+
lifecycle:
63+
stopSignal: SIGINT
64+
{{- end }}
5565
{{- $apiArgs := concat (list (printf "--components=%s" (include "abstract-node.haApiComponents" .))) .Values.ha.api.extraArgs }}
5666
{{ include "abstract-node.nodeArgs" (dict "root" . "args" $apiArgs) | nindent 10 }}
5767
env:

‎charts/abstract-node/templates/statefulset.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{{- $kubeVersion := .Capabilities.KubeVersion.Version | trimPrefix "v" -}}
2+
{{- $supportsStopSignal := semverCompare ">=1.33.0-0" $kubeVersion -}}
13
---
24
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
35
kind: StatefulSet
@@ -52,6 +54,10 @@ spec:
5254
{{- end }}
5355
{{- if .Values.terminationGracePeriodSeconds }}
5456
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
57+
{{- end }}
58+
{{- if $supportsStopSignal }}
59+
os:
60+
name: linux
5561
{{- end }}
5662
serviceAccountName: {{ include "common.names.serviceAccountName" . }}
5763
priorityClassName: {{ .Values.priorityClassName | quote }}
@@ -78,6 +84,10 @@ spec:
7884
- name: {{ .Chart.Name }}
7985
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
8086
imagePullPolicy: {{ .Values.image.pullPolicy }}
87+
{{- if $supportsStopSignal }}
88+
lifecycle:
89+
stopSignal: SIGINT
90+
{{- end }}
8191
{{- if .Values.ha.enabled }}
8292
{{- $coreArgs := concat (list (printf "--components=%s" (include "abstract-node.haCoreComponents" .))) .Values.ha.core.extraArgs }}
8393
{{ include "abstract-node.nodeArgs" (dict "root" . "args" $coreArgs) | nindent 10 }}

‎charts/abstract-node/values.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ serviceAccount:
153153
## Termination Grace Period
154154
## ref: https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/#delete-pods
155155
##
156-
terminationGracePeriodSeconds: 300
156+
terminationGracePeriodSeconds: 30
157157

158158
## RBAC configuration.
159159
## ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/

0 commit comments

Comments
 (0)