Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow using templating with terminationGracePeriodSeconds #325

Merged
merged 5 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/daemonset-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: daemonset-app
description: Default DaemonSet Helm Chart
type: application
version: 0.15.5
version: 0.16.0
appVersion: latest
maintainers:
- name: diranged
Expand Down
13 changes: 10 additions & 3 deletions charts/daemonset-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Default DaemonSet Helm Chart

![Version: 0.15.5](https://img.shields.io/badge/Version-0.15.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 0.16.0](https://img.shields.io/badge/Version-0.16.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

[statefulsets]: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
[hpa]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Expand All @@ -13,6 +13,13 @@ ServiceAccounts, Services, etc.

## Upgrade Notes

### 1.15.x -> 1.16.x

**NEW: Templated Termination Grace Period**

`terminationGracePeriodSeconds` now supports template variables. This allows
one to compute the termination grace period based on additional criteria.

### 0.13.0 -> 0.14.x

**BREAKING: Bugfix removing the default readiness and liveness probes **
Expand Down Expand Up @@ -351,12 +358,12 @@ secretsEngine: sealed
| targetOperatingSystem | `string` | `"linux"` | If set, this value will be used in the .spec.nodeSelector to ensure that these pods specifically launch on the desired target Operating System. Must be set. |
| terminationGracePeriodSeconds | string | `nil` | https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution |
| tests.connection.args | list | `["$(HOST_IP)"]` | A list of arguments passed into the command. These are run through the tpl function. |
| tests.connection.command | list | `["curl","--verbose","--retry-connrefused","--retry","5","--retry-delay","10"]` | The command used to trigger the test. |
| tests.connection.command | list | `["curl","-4","--verbose","--retry-connrefused","--retry","5","--retry-delay","10"]` | The command used to trigger the test. |
| tests.connection.enabled | bool | `true` | Controls whether or not this Helm test component is enabled. |
| tests.connection.image.repository | string | `nil` | Sets the image-name that will be used in the "connection" integration test. If this is left empty, then the .image.repository value will be used instead (and the .image.tag will also be used). |
| tests.connection.image.tag | string | `nil` | Sets the tag that will be used in the "connection" integration test. If this is left empty, the default is "latest" |
| tests.svcConnection.args | list | `["{{ include \"nd-common.fullname\" . }}"]` | A list of arguments passed into the command. These are run through the tpl function. |
| tests.svcConnection.command | list | `["curl","--verbose","--retry-connrefused","--retry","5","--retry-delay","10"]` | The command used to trigger the test. |
| tests.svcConnection.command | list | `["curl","-4","--verbose","--retry-connrefused","--retry","5","--retry-delay","10"]` | The command used to trigger the test. |
| tests.svcConnection.enabled | bool | `true` | Controls whether or not this Helm test component is enabled. |
| tests.svcConnection.image.repository | string | `nil` | Sets the image-name that will be used in the "connection" integration test. If this is left empty, then the .image.repository value will be used instead (and the .image.tag will also be used). |
| tests.svcConnection.image.tag | string | `nil` | Sets the tag that will be used in the "connection" integration test. If this is left empty, the default is "latest" |
Expand Down
7 changes: 7 additions & 0 deletions charts/daemonset-app/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ ServiceAccounts, Services, etc.

## Upgrade Notes

### 1.15.x -> 1.16.x

**NEW: Templated Termination Grace Period**

`terminationGracePeriodSeconds` now supports template variables. This allows
one to compute the termination grace period based on additional criteria.

### 0.13.0 -> 0.14.x

**BREAKING: Bugfix removing the default readiness and liveness probes **
Expand Down
2 changes: 1 addition & 1 deletion charts/daemonset-app/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccountName: {{ include "nd-common.serviceAccountName" . }}
{{- with .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
terminationGracePeriodSeconds: {{ tpl (toString . ) $ }}
{{- end }}
{{- if or .Values.volumes .Values.volumesString }}
volumes:
Expand Down
2 changes: 0 additions & 2 deletions charts/daemonset-app/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apiVersion: v1
kind: Pod
metadata:
name: "{{ include "nd-common.fullname" . }}-test-connection"
labels:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how this ever worked helm/helm#8058

{{- include "nd-common.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apiVersion: v1
kind: Pod
metadata:
name: "{{ include "nd-common.fullname" . }}-test-service-connection"
labels:
{{- include "nd-common.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
Expand Down
4 changes: 2 additions & 2 deletions charts/daemonset-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ tests:
enabled: true

# -- The command used to trigger the test.
command: [curl, --verbose, --retry-connrefused, --retry, '5', --retry-delay, '10']
command: [curl, '-4', --verbose, --retry-connrefused, --retry, '5', --retry-delay, '10']
# -- A list of arguments passed into the command. These are run through the tpl function.
args:
- "$(HOST_IP)"
Expand All @@ -528,7 +528,7 @@ tests:
enabled: true

# -- The command used to trigger the test.
command: [curl, --verbose, --retry-connrefused, --retry, '5', --retry-delay, '10']
command: [curl, '-4', --verbose, --retry-connrefused, --retry, '5', --retry-delay, '10']
# -- A list of arguments passed into the command. These are run through the tpl function.
args:
- '{{ include "nd-common.fullname" . }}'
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: rollout-app
description: Argo Rollout-based Application Helm Chart
type: application
version: 1.1.1
version: 1.2.0
appVersion: latest
maintainers:
- name: diranged
Expand Down
9 changes: 8 additions & 1 deletion charts/rollout-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Argo Rollout-based Application Helm Chart

![Version: 1.1.1](https://img.shields.io/badge/Version-1.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 1.2.0](https://img.shields.io/badge/Version-1.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

[analysistemplate]: https://argoproj.github.io/argo-rollouts/features/analysis/?query=AnalysisTemplate#background-analysis
[argo_rollouts]: https://argoproj.github.io/argo-rollouts/
Expand All @@ -18,6 +18,13 @@ how these work, and the various custom resource definitions.

## Upgrade Notes

### 1.1.x -> 1.2.x

**NEW: Templated Termination Grace Period**

`terminationGracePeriodSeconds` now supports template variables. This allows
one to compute the termination grace period based on additional criteria.

### 0.7.x -> 1.0.x

**BREAKING: Istio Alerts have changed**
Expand Down
7 changes: 7 additions & 0 deletions charts/rollout-app/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ how these work, and the various custom resource definitions.

## Upgrade Notes

### 1.1.x -> 1.2.x

**NEW: Templated Termination Grace Period**

`terminationGracePeriodSeconds` now supports template variables. This allows
one to compute the termination grace period based on additional criteria.

### 0.7.x -> 1.0.x

**BREAKING: Istio Alerts have changed**
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccountName: {{ include "nd-common.serviceAccountName" . }}
{{- with .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
terminationGracePeriodSeconds: {{ tpl (toString . ) $ }}
{{- end }}
{{- if or .Values.volumes .Values.volumesString }}
volumes:
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: simple-app
description: Default Microservice Helm Chart
type: application
version: 1.9.0
version: 1.10.0
appVersion: latest
maintainers:
- name: diranged
Expand Down
9 changes: 8 additions & 1 deletion charts/simple-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Default Microservice Helm Chart

![Version: 1.9.0](https://img.shields.io/badge/Version-1.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 1.10.0](https://img.shields.io/badge/Version-1.10.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

[deployments]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
[hpa]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Expand All @@ -13,6 +13,13 @@ defaults for you like the Kubernetes [Horizontal Pod Autoscaler][hpa].

## Upgrade Notes

### 1.9.x -> 1.10.x

**NEW: Templated Termination Grace Period**

`terminationGracePeriodSeconds` now supports template variables. This allows
one to compute the termination grace period based on additional criteria.

### 1.8.x -> 1.9.x

`readinessProbe` is now only required when `virtualService.enabled` is `true`. This
Expand Down
7 changes: 7 additions & 0 deletions charts/simple-app/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ defaults for you like the Kubernetes [Horizontal Pod Autoscaler][hpa].

## Upgrade Notes

### 1.9.x -> 1.10.x

**NEW: Templated Termination Grace Period**

`terminationGracePeriodSeconds` now supports template variables. This allows
one to compute the termination grace period based on additional criteria.

### 1.8.x -> 1.9.x

`readinessProbe` is now only required when `virtualService.enabled` is `true`. This
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ spec:
{{- toYaml $.Values.podSecurityContext | nindent 8 }}
serviceAccountName: {{ include "nd-common.serviceAccountName" $ }}
{{- with $.Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
terminationGracePeriodSeconds: {{ tpl ( toString . ) $ }}
{{- end }}
{{- if or $.Values.volumes $.Values.volumesString }}
volumes:
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: stateful-app
description: Default StatefulSet Helm Chart
type: application
version: 1.1.1
version: 1.2.0
appVersion: latest
maintainers:
- name: diranged
Expand Down
9 changes: 8 additions & 1 deletion charts/stateful-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Default StatefulSet Helm Chart

![Version: 1.1.1](https://img.shields.io/badge/Version-1.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 1.2.0](https://img.shields.io/badge/Version-1.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

[statefulsets]: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
[hpa]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Expand All @@ -13,6 +13,13 @@ ServiceAccounts, Services, etc.

## Upgrade Notes

### 1.1.x -> 1.2.x

**NEW: Templated Termination Grace Period**

`terminationGracePeriodSeconds` now supports template variables. This allows
one to compute the termination grace period based on additional criteria.

### 0.16.x -> 1.0.x

**BREAKING: Istio Alerts have changed**
Expand Down
7 changes: 7 additions & 0 deletions charts/stateful-app/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ ServiceAccounts, Services, etc.

## Upgrade Notes

### 1.1.x -> 1.2.x

**NEW: Templated Termination Grace Period**

`terminationGracePeriodSeconds` now supports template variables. This allows
one to compute the termination grace period based on additional criteria.

### 0.16.x -> 1.0.x

**BREAKING: Istio Alerts have changed**
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccountName: {{ include "nd-common.serviceAccountName" . }}
{{- with .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
terminationGracePeriodSeconds: {{ tpl (toString . ) $ }}
{{- end }}
{{- if or .Values.volumes .Values.volumesString }}
volumes:
Expand Down
3 changes: 1 addition & 2 deletions ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
remote: origin
chart-dirs:
- charts
# https://github.com/helm/chart-testing-action/issues/135
# helm-extra-args: --timeout 600s
helm-extra-args: --timeout 300s
target-branch: main
validate-maintainers: false
chart-repos:
Expand Down
Loading