From 30342826e604e102a121ff297731c17d85e06714 Mon Sep 17 00:00:00 2001 From: Claudio Cavina Date: Thu, 20 Nov 2025 17:34:51 +0100 Subject: [PATCH 1/6] feat: Set rolling update strategy, pod distruption budget and replicaCount to 3 for production environments --- Chart.yaml | 2 +- README.md | 4 ++++ templates/deployment.yaml | 5 +++++ templates/pdb.yaml | 12 ++++++++++++ values.yaml | 11 ++++++++++- 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 templates/pdb.yaml diff --git a/Chart.yaml b/Chart.yaml index 35967a4..2b379c9 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.2 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/README.md b/README.md index aebee70..9c26369 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ ## Changelog +### 0.3.0 +Set rolling update strategy, pod distruption budget and replicaCount to 3 for production environments. +For Sandbox and Development environments we must set replicaCount in values.yaml to 1 and pdb.enabled to false. + ### 0.2.2 Set container name for deployment. diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 32bf3fe..2ba5a0e 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -9,6 +9,11 @@ spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: {{ .Values.rollingUpdate.maxUnavailable | default 1 }} + maxSurge: {{ .Values.rollingUpdate.maxSurge | default 1 }} selector: matchLabels: {{- include "pyhchart.selectorLabels" . | nindent 6 }} diff --git a/templates/pdb.yaml b/templates/pdb.yaml new file mode 100644 index 0000000..a418a65 --- /dev/null +++ b/templates/pdb.yaml @@ -0,0 +1,12 @@ +{{- if .Values.pdb.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "pyhchart.fullname" . }}-pdb + namespace: {{ include "common.names.namespace" . | quote }} +spec: + minAvailable: {{ .Values.pdb.minAvailable | default 1 }} + selector: + matchLabels: + {{- include "pyhchart.selectorLabels" . | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index 5fd5b84..b7420f1 100644 --- a/values.yaml +++ b/values.yaml @@ -2,7 +2,16 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 +replicaCount: 3 + +rollingUpdate: + maxUnavailable: 1 + maxSurge: 1 + +# for +pdb: + enabled: true + minAvailable: 1 image: repository: From a87e862d524ad7b170c1f4479389174d8ae6afdc Mon Sep 17 00:00:00 2001 From: Claudio Cavina Date: Fri, 21 Nov 2025 09:23:59 +0100 Subject: [PATCH 2/6] fix: fix chart version --- Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 2b379c9..e360d40 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.0 +version: 0.3.0-rc1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to From a513745a7eec5053a481cc593d99a8ecb92f3769 Mon Sep 17 00:00:00 2001 From: Claudio Cavina Date: Fri, 21 Nov 2025 11:10:26 +0100 Subject: [PATCH 3/6] chore: change pod distruption budget default minAvailable value to 2 --- Chart.yaml | 2 +- templates/pdb.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index e360d40..95d0989 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.0-rc1 +version: 0.3.1-rc1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/templates/pdb.yaml b/templates/pdb.yaml index a418a65..d439fbf 100644 --- a/templates/pdb.yaml +++ b/templates/pdb.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "pyhchart.fullname" . }}-pdb namespace: {{ include "common.names.namespace" . | quote }} spec: - minAvailable: {{ .Values.pdb.minAvailable | default 1 }} + minAvailable: {{ .Values.pdb.minAvailable | default 2 }} selector: matchLabels: {{- include "pyhchart.selectorLabels" . | nindent 6 }} From fe141bfa4a6ad8e4f8125831fab1845c706c0c46 Mon Sep 17 00:00:00 2001 From: Claudio Cavina Date: Fri, 21 Nov 2025 11:34:13 +0100 Subject: [PATCH 4/6] fix: fix pod distruption budget default minAvailable value to 2 --- Chart.yaml | 2 +- values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 95d0989..82e6a2a 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.1-rc1 +version: 0.3.2-rc1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/values.yaml b/values.yaml index b7420f1..8b6d61b 100644 --- a/values.yaml +++ b/values.yaml @@ -11,7 +11,7 @@ rollingUpdate: # for pdb: enabled: true - minAvailable: 1 + minAvailable: 2 image: repository: From f0f95ace870de74bcbcb4ec9c01823544e885936 Mon Sep 17 00:00:00 2001 From: Claudio Cavina Date: Fri, 21 Nov 2025 11:54:46 +0100 Subject: [PATCH 5/6] chore: deploy final version 0.3.2 --- Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 82e6a2a..2a01148 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.2-rc1 +version: 0.3.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to From c0cf4aeb95627e761d86a912b0f4357d14b375a9 Mon Sep 17 00:00:00 2001 From: Michele Mondelli Date: Wed, 3 Dec 2025 16:41:41 +0100 Subject: [PATCH 6/6] feat: update default values --- Chart.yaml | 2 +- README.md | 22 ++++++++++++++++------ values.yaml | 13 ++++++++----- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 2a01148..c05c631 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.2 +version: 0.3.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/README.md b/README.md index 9c26369..d536ae1 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,34 @@ # Helmchart for generic python application -[![Packahe Helm Chart](https://github.com/zcsadmin/ml-pyhchart-helmchart/actions/workflows/helm-package.yml/badge.svg)](https://github.com/zcsadmin/ml-pyhchart-helmchart/actions/workflows/helm-package.yml) +[![Package Helm Chart](https://github.com/zcsadmin/ml-pyhchart-helmchart/actions/workflows/helm-package.yml/badge.svg)](https://github.com/zcsadmin/ml-pyhchart-helmchart/actions/workflows/helm-package.yml) [![Push Helm Chart to Artifact Registry](https://github.com/zcsadmin/ml-pyhchart-helmchart/actions/workflows/helm-push.yml/badge.svg)](https://github.com/zcsadmin/ml-pyhchart-helmchart/actions/workflows/helm-push.yml) - ## Changelog +### 0.3.3 + +Set rolling update strategy, pod disruption budget and replicaCount to 1. + ### 0.3.0 -Set rolling update strategy, pod distruption budget and replicaCount to 3 for production environments. -For Sandbox and Development environments we must set replicaCount in values.yaml to 1 and pdb.enabled to false. -### 0.2.2 +Set rolling update strategy, pod disruption budget and replicaCount to 3 for production environments. +For Sandbox and Development environments we must set replicaCount in values.yaml to 1 and pdb.enabled to false. + +### 0.2.2 + Set container name for deployment. ### 0.2.1 + Enhance secrets support. ### 0.2.0 + Add support for secret values. ### 0.1.0 + Initial chart release. ## Artifact Repository @@ -28,6 +36,7 @@ Initial chart release. `oci://europe-west1-docker.pkg.dev/ai-accounting-405809/ml-helm-charts/pyhchart` List docker images from cli: + ```bash gcloud artifacts docker images list europe-west1-docker.pkg.dev/ai-accounting-405809/ml-helm-charts ``` @@ -37,10 +46,11 @@ gcloud artifacts docker images list europe-west1-docker.pkg.dev/ai-accounting-40 You need to download the chart locally and `appVersion` value in `Chart.yaml` file. Also, you need a `values-app.yaml` file with the specific values for your application. Then, you can install the application with the following command: + ```bash helm install YOUR_APP -f values-app.yaml . ``` ## Useful links - - [Artifact repository](https://console.cloud.google.com/artifacts/docker/ai-accounting-405809/europe-west1/ml-helm-charts/pyhchart?project=ai-accounting-405809) +- [Artifact repository](https://console.cloud.google.com/artifacts/docker/ai-accounting-405809/europe-west1/ml-helm-charts/pyhchart?project=ai-accounting-405809) diff --git a/values.yaml b/values.yaml index 8b6d61b..2fed505 100644 --- a/values.yaml +++ b/values.yaml @@ -2,16 +2,19 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 3 +replicaCount: 1 +# https://www.baeldung.com/ops/deployment-rollout-kubernetes +# https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-update-deployment rollingUpdate: - maxUnavailable: 1 - maxSurge: 1 + maxUnavailable: 25% + maxSurge: 25% -# for +# https://www.baeldung.com/ops/kubernetes-pod-disruption-budget +# https://kubernetes.io/docs/tasks/run-application/configure-pdb/ pdb: enabled: true - minAvailable: 2 + minAvailable: 1 image: repository: