Skip to content

Commit

Permalink
feat(conf): Add migrations.ttlSecondsAfterFinished to chart template (#…
Browse files Browse the repository at this point in the history
…1174)

* update chart to support ttlSecondsAfterFinished on migration pods

* added migrations.ttlSecondsAfterFinished

* feat conditional volumes on migration pods

* updated to include ttlSecondsAfterFinished

* updated with github link

* remove unwanted changes

* remove unwanted changes
  • Loading branch information
ashman1984 authored Nov 29, 2024
1 parent 28af4cb commit 2e95d00
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased
* Added serviceMonitor.trustCRDsExist for render based deployments
* Add `migrations.ttlSecondsAfterFinished` option to chart
[#1174](https://github.com/Kong/charts/pull/1174)

### Changes

Expand Down
1 change: 1 addition & 0 deletions charts/kong/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ directory.
| migrations.preUpgrade | Run "kong migrations up" jobs | `true` |
| migrations.postUpgrade | Run "kong migrations finish" jobs | `true` |
| migrations.annotations | Annotations for migration job pods | `{"sidecar.istio.io/inject": "false" |
| migrations.ttlSecondsAfterFinished | Automatically deletes completed pods after a specified time to clean up resources | |
| migrations.jobAnnotations | Additional annotations for migration jobs | `{}` |
| migrations.backoffLimit | Override the system backoffLimit | `{}` |
| waitImage.enabled | Spawn init containers that wait for the database before starting Kong | `true` |
Expand Down
3 changes: 3 additions & 0 deletions charts/kong/templates/migrations-post-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ metadata:
{{- end }}
spec:
backoffLimit: {{ .Values.migrations.backoffLimit }}
{{- if .Values.migrations.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ .Values.migrations.ttlSecondsAfterFinished }}
{{- end }}
template:
metadata:
name: {{ template "kong.name" . }}-post-upgrade-migrations
Expand Down
3 changes: 3 additions & 0 deletions charts/kong/templates/migrations-pre-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ metadata:
{{- end }}
spec:
backoffLimit: {{ .Values.migrations.backoffLimit }}
{{- if .Values.migrations.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ .Values.migrations.ttlSecondsAfterFinished }}
{{- end }}
template:
metadata:
name: {{ template "kong.name" . }}-pre-upgrade-migrations
Expand Down
3 changes: 3 additions & 0 deletions charts/kong/templates/migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ metadata:
{{- end }}
spec:
backoffLimit: {{ .Values.migrations.backoffLimit }}
{{- if .Values.migrations.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ .Values.migrations.ttlSecondsAfterFinished }}
{{- end }}
template:
metadata:
name: {{ template "kong.name" . }}-init-migrations
Expand Down
2 changes: 2 additions & 0 deletions charts/kong/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ migrations:
jobAnnotations: {}
# Optionally set a backoffLimit. If none is set, Jobs will use the cluster default
backoffLimit:
# Optionally set to specify the time-to-live (TTL) for a pod after it has completed its execution before automatic deletion. If left unset, pod lifetime is indefinite.
ttlSecondsAfterFinished:
resources: {}
# Example reasonable setting for "resources":
# resources:
Expand Down

0 comments on commit 2e95d00

Please sign in to comment.