Skip to content

Commit 39412e8

Browse files
authored
add support for container lifecycle hooks and bump version (#73)
* add support for container lifecycle hooks and bump version * bump minor version
1 parent f83eb3c commit 39412e8

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

standard-app/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: standard-app
33
description: A Helm chart library by Cloudkite
44
type: application
5-
version: 1.2.1
5+
version: 1.3.0
66
maintainters:
77
88
name: cloudkite

standard-app/example.values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ apps:
198198
env:
199199
CONTAINER_ENV1: asd
200200
CONTAINER_ENV2: qwe
201+
lifecycle:
202+
preStop:
203+
exec:
204+
command: ["/bin/sh", "-c", "echo PreStop Hook Executed"]
201205
example-container-2:
202206
image: us-central1-docker.pkg.dev/cloudkite-infra-ops/cloudkite-docker-images/app-1
203207
tag: tag-1

standard-app/templates/workloads/_container.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ Required dict keys:
7979
{{- toYaml . | nindent 4 }}
8080
{{- end }}
8181
{{- end }}
82+
{{- if or (hasKey .container "lifecycle") (hasKey $app "lifecycle") }}
83+
lifecycle:
84+
{{- with or (index .container "lifecycle") (index $app "lifecycle") }}
85+
{{- toYaml . | nindent 4 }}
86+
{{- end }}
87+
{{- end }}
8288
{{- if or (hasKey .container "volumes") (hasKey $app "volumes") }}
8389
volumeMounts:
8490
{{- $volumes := (hasKey .container "volumes" | ternary (index .container "volumes") (index $app "volumes")) }}

standard-app/templates/workloads/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ spec:
6262
{{- if $appConfig.serviceAccount }}
6363
serviceAccountName: {{ $appConfig.serviceAccount }}
6464
{{- end }}
65+
{{- if $appConfig.terminationGracePeriodSeconds }}
66+
terminationGracePeriodSeconds: {{ $appConfig.terminationGracePeriodSeconds }}
67+
{{- end }}
6568
{{- if $appConfig.initContainers }}
6669
initContainers:
6770
{{- range $initContainerName, $initContainerConfig := $appConfig.initContainers }}

0 commit comments

Comments
 (0)