From c0773f284d25e0d0aa0bc21441256589f40967a5 Mon Sep 17 00:00:00 2001 From: Slava Markeyev Date: Tue, 6 Aug 2024 10:38:07 -0700 Subject: [PATCH 1/5] feat: allow using templating with terminationGracePeriodSeconds --- charts/daemonset-app/Chart.yaml | 2 +- charts/daemonset-app/README.md | 9 ++++++++- charts/daemonset-app/README.md.gotmpl | 7 +++++++ charts/daemonset-app/templates/daemonset.yaml | 2 +- charts/rollout-app/Chart.yaml | 2 +- charts/rollout-app/README.md | 9 ++++++++- charts/rollout-app/README.md.gotmpl | 7 +++++++ charts/rollout-app/templates/rollout.yaml | 2 +- charts/simple-app/Chart.yaml | 2 +- charts/simple-app/README.md | 9 ++++++++- charts/simple-app/README.md.gotmpl | 7 +++++++ charts/simple-app/templates/deployment.yaml | 2 +- charts/stateful-app/Chart.yaml | 2 +- charts/stateful-app/README.md | 9 ++++++++- charts/stateful-app/README.md.gotmpl | 7 +++++++ charts/stateful-app/templates/statefulset.yaml | 2 +- 16 files changed, 68 insertions(+), 12 deletions(-) diff --git a/charts/daemonset-app/Chart.yaml b/charts/daemonset-app/Chart.yaml index 3c240c4c..48b47c49 100644 --- a/charts/daemonset-app/Chart.yaml +++ b/charts/daemonset-app/Chart.yaml @@ -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 diff --git a/charts/daemonset-app/README.md b/charts/daemonset-app/README.md index 57deefc4..2bfa15fc 100644 --- a/charts/daemonset-app/README.md +++ b/charts/daemonset-app/README.md @@ -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/ @@ -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 ** diff --git a/charts/daemonset-app/README.md.gotmpl b/charts/daemonset-app/README.md.gotmpl index 91b92760..ac043d82 100644 --- a/charts/daemonset-app/README.md.gotmpl +++ b/charts/daemonset-app/README.md.gotmpl @@ -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 ** diff --git a/charts/daemonset-app/templates/daemonset.yaml b/charts/daemonset-app/templates/daemonset.yaml index 823f9f59..bea2d3ae 100644 --- a/charts/daemonset-app/templates/daemonset.yaml +++ b/charts/daemonset-app/templates/daemonset.yaml @@ -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: diff --git a/charts/rollout-app/Chart.yaml b/charts/rollout-app/Chart.yaml index 7e4ee743..26cd80f6 100644 --- a/charts/rollout-app/Chart.yaml +++ b/charts/rollout-app/Chart.yaml @@ -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 diff --git a/charts/rollout-app/README.md b/charts/rollout-app/README.md index baa368ff..32d93080 100644 --- a/charts/rollout-app/README.md +++ b/charts/rollout-app/README.md @@ -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/ @@ -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** diff --git a/charts/rollout-app/README.md.gotmpl b/charts/rollout-app/README.md.gotmpl index a7fef8ad..21611bc3 100644 --- a/charts/rollout-app/README.md.gotmpl +++ b/charts/rollout-app/README.md.gotmpl @@ -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** diff --git a/charts/rollout-app/templates/rollout.yaml b/charts/rollout-app/templates/rollout.yaml index 784c12f5..97deefb8 100644 --- a/charts/rollout-app/templates/rollout.yaml +++ b/charts/rollout-app/templates/rollout.yaml @@ -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: diff --git a/charts/simple-app/Chart.yaml b/charts/simple-app/Chart.yaml index 59476811..7eae076e 100644 --- a/charts/simple-app/Chart.yaml +++ b/charts/simple-app/Chart.yaml @@ -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 diff --git a/charts/simple-app/README.md b/charts/simple-app/README.md index a7d33b6a..3077eb07 100644 --- a/charts/simple-app/README.md +++ b/charts/simple-app/README.md @@ -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/ @@ -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 diff --git a/charts/simple-app/README.md.gotmpl b/charts/simple-app/README.md.gotmpl index 509afcdd..a9e35d15 100644 --- a/charts/simple-app/README.md.gotmpl +++ b/charts/simple-app/README.md.gotmpl @@ -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 diff --git a/charts/simple-app/templates/deployment.yaml b/charts/simple-app/templates/deployment.yaml index 1cbd4006..be538066 100644 --- a/charts/simple-app/templates/deployment.yaml +++ b/charts/simple-app/templates/deployment.yaml @@ -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: diff --git a/charts/stateful-app/Chart.yaml b/charts/stateful-app/Chart.yaml index 246122b9..4104dbcb 100644 --- a/charts/stateful-app/Chart.yaml +++ b/charts/stateful-app/Chart.yaml @@ -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 diff --git a/charts/stateful-app/README.md b/charts/stateful-app/README.md index 69048056..a22a3161 100644 --- a/charts/stateful-app/README.md +++ b/charts/stateful-app/README.md @@ -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/ @@ -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** diff --git a/charts/stateful-app/README.md.gotmpl b/charts/stateful-app/README.md.gotmpl index 1a4b0ba2..dbbde04e 100644 --- a/charts/stateful-app/README.md.gotmpl +++ b/charts/stateful-app/README.md.gotmpl @@ -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** diff --git a/charts/stateful-app/templates/statefulset.yaml b/charts/stateful-app/templates/statefulset.yaml index c73ba71a..ee267272 100644 --- a/charts/stateful-app/templates/statefulset.yaml +++ b/charts/stateful-app/templates/statefulset.yaml @@ -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: From d4fc72c287552e0266457ec71b7ccbd91c6f1453 Mon Sep 17 00:00:00 2001 From: Slava Markeyev Date: Tue, 6 Aug 2024 11:43:12 -0700 Subject: [PATCH 2/5] re-introduce timeout --- ct.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ct.yaml b/ct.yaml index 55210126..53476b8c 100644 --- a/ct.yaml +++ b/ct.yaml @@ -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 120s target-branch: main validate-maintainers: false chart-repos: From b592176280b32dac6e46f1f24fd28648e901ba65 Mon Sep 17 00:00:00 2001 From: Slava Markeyev Date: Tue, 6 Aug 2024 14:37:50 -0700 Subject: [PATCH 3/5] remove labels from tests --- charts/daemonset-app/templates/tests/test-connection.yaml | 2 -- .../templates/tests/test-service-connection.yaml | 2 -- charts/daemonset-app/values.yaml | 4 ++-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/charts/daemonset-app/templates/tests/test-connection.yaml b/charts/daemonset-app/templates/tests/test-connection.yaml index c9bf202f..72ba8606 100644 --- a/charts/daemonset-app/templates/tests/test-connection.yaml +++ b/charts/daemonset-app/templates/tests/test-connection.yaml @@ -3,8 +3,6 @@ apiVersion: v1 kind: Pod metadata: name: "{{ include "nd-common.fullname" . }}-test-connection" - labels: - {{- include "nd-common.labels" . | nindent 4 }} annotations: "helm.sh/hook": test "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded diff --git a/charts/daemonset-app/templates/tests/test-service-connection.yaml b/charts/daemonset-app/templates/tests/test-service-connection.yaml index 87dfcaec..70194056 100644 --- a/charts/daemonset-app/templates/tests/test-service-connection.yaml +++ b/charts/daemonset-app/templates/tests/test-service-connection.yaml @@ -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 diff --git a/charts/daemonset-app/values.yaml b/charts/daemonset-app/values.yaml index 475dda39..a8d5aab9 100644 --- a/charts/daemonset-app/values.yaml +++ b/charts/daemonset-app/values.yaml @@ -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)" @@ -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" . }}' From 6bcd59d06b5517a489a36f72dc440999e0a80c68 Mon Sep 17 00:00:00 2001 From: Slava Markeyev Date: Tue, 6 Aug 2024 14:39:44 -0700 Subject: [PATCH 4/5] update helm docs --- charts/daemonset-app/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/daemonset-app/README.md b/charts/daemonset-app/README.md index 2bfa15fc..a94706d9 100644 --- a/charts/daemonset-app/README.md +++ b/charts/daemonset-app/README.md @@ -358,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" | From 9aebe5f802883b488412bef32fda26d147ff1603 Mon Sep 17 00:00:00 2001 From: Slava Markeyev Date: Tue, 6 Aug 2024 14:50:53 -0700 Subject: [PATCH 5/5] increase wait time --- ct.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct.yaml b/ct.yaml index 53476b8c..f2540dc0 100644 --- a/ct.yaml +++ b/ct.yaml @@ -2,7 +2,7 @@ remote: origin chart-dirs: - charts -helm-extra-args: --timeout 120s +helm-extra-args: --timeout 300s target-branch: main validate-maintainers: false chart-repos: