From 9a6389301012fab427e04073237298d1d5fe453d Mon Sep 17 00:00:00 2001 From: Evgenii Tereshkov Date: Fri, 15 Apr 2022 21:06:48 +0700 Subject: [PATCH 1/4] Removed helm hooks annotations for PVC --- .../results/web-app.values.yml | 41 +++++++++---------- charts/universal-chart/templates/pvc.yml | 1 - charts/universal-chart/testit.sh | 2 +- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/charts/universal-chart/results/web-app.values.yml b/charts/universal-chart/results/web-app.values.yml index 5077576..f6d6761 100644 --- a/charts/universal-chart/results/web-app.values.yml +++ b/charts/universal-chart/results/web-app.values.yml @@ -1,4 +1,23 @@ --- +# Source: universal-chart/templates/pvc.yml +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: test-app-data + namespace: default + labels: + app.kubernetes.io/name: test + app.kubernetes.io/instance: test + app.kubernetes.io/managed-by: Helm + annotations: +spec: + accessModes: + - ReadWriteOnce + - ReadWriteMany + resources: + requests: + storage: 1Gi +--- # Source: universal-chart/templates/svc.yml kind: Service apiVersion: v1 @@ -275,25 +294,3 @@ data: events { worker_connections 1024; } ---- -# Source: universal-chart/templates/pvc.yml -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: test-app-data - namespace: default - labels: - app.kubernetes.io/name: test - app.kubernetes.io/instance: test - app.kubernetes.io/managed-by: Helm - annotations: - helm.sh/hook: "pre-install,pre-upgrade" - helm.sh/hook-weight: "-999" - helm.sh/hook-delete-policy: before-hook-creation -spec: - accessModes: - - ReadWriteOnce - - ReadWriteMany - resources: - requests: - storage: 1Gi diff --git a/charts/universal-chart/templates/pvc.yml b/charts/universal-chart/templates/pvc.yml index b625f62..4c17383 100644 --- a/charts/universal-chart/templates/pvc.yml +++ b/charts/universal-chart/templates/pvc.yml @@ -9,7 +9,6 @@ metadata: {{- include "helpers.app.labels" $ | nindent 4 }} {{- with .labels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }} annotations: - {{- include "helpers.app.hooksAnnotations" $ | nindent 4 }} {{- with .annotations }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }} spec: accessModes: {{- include "helpers.tplvalues.render" ( dict "value" .accessModes "context" $ ) | nindent 4 }} diff --git a/charts/universal-chart/testit.sh b/charts/universal-chart/testit.sh index 464192a..e125b31 100755 --- a/charts/universal-chart/testit.sh +++ b/charts/universal-chart/testit.sh @@ -1,4 +1,4 @@ -#!/bin/sh -eux +#!/bin/sh -eu dname=$(dirname $0) tests="$dname/tests" rm -rf --one-file-system $tests From 7ca86d0ea92f10331f43bd0e3035a57be5c394f9 Mon Sep 17 00:00:00 2001 From: Evgenii Tereshkov Date: Fri, 15 Apr 2022 21:11:24 +0700 Subject: [PATCH 2/4] Fix Service nodePort --- charts/universal-chart/README.md | 2 +- charts/universal-chart/results/web-app.values.yml | 1 + charts/universal-chart/samples/web-app.values.yml | 1 + charts/universal-chart/templates/svc.yml | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/universal-chart/README.md b/charts/universal-chart/README.md index 414bc8f..6a33bd1 100644 --- a/charts/universal-chart/README.md +++ b/charts/universal-chart/README.md @@ -167,6 +167,7 @@ The command removes all the Kubernetes components associated with the chart and | `protocol` | Protocol of the service port | `"TCP"` | | `port` | Service port number | `` | | `targetPort` | Service target port number | `` | +| `nodePort` | Service NodePort number | `` | ### Ingresses parameters @@ -193,7 +194,6 @@ The command removes all the Kubernetes components associated with the chart and ### Ingress `paths` object parameters - | Name | Description | Value | |---------------|-------------------------------------------------------------------------------------------------------------------------|-------| | `path` | URL path | `"/"` | diff --git a/charts/universal-chart/results/web-app.values.yml b/charts/universal-chart/results/web-app.values.yml index f6d6761..ab888fb 100644 --- a/charts/universal-chart/results/web-app.values.yml +++ b/charts/universal-chart/results/web-app.values.yml @@ -36,6 +36,7 @@ spec: - name: api protocol: TCP port: 8080 + nodePort: 30036 selector: app.kubernetes.io/name: test app.kubernetes.io/instance: test diff --git a/charts/universal-chart/samples/web-app.values.yml b/charts/universal-chart/samples/web-app.values.yml index b712780..3838a2e 100644 --- a/charts/universal-chart/samples/web-app.values.yml +++ b/charts/universal-chart/samples/web-app.values.yml @@ -121,6 +121,7 @@ services: - name: api protocol: TCP port: 8080 + nodePort: 30036 extraSelectorLabels: app: my-app diff --git a/charts/universal-chart/templates/svc.yml b/charts/universal-chart/templates/svc.yml index ff59588..6890f36 100644 --- a/charts/universal-chart/templates/svc.yml +++ b/charts/universal-chart/templates/svc.yml @@ -44,6 +44,9 @@ spec: {{- if not (empty .targetPort) }} targetPort: {{ .targetPort }} {{- end }} + {{- if not (empty .nodePort) }} + nodePort: {{ .nodePort }} + {{- end }} {{- end }} selector: {{- include "helpers.app.selectorLabels" $ | nindent 4 }} From f259a2dc3e549bfc8eb0a462ac400e69f2873ee8 Mon Sep 17 00:00:00 2001 From: Evgenii Tereshkov Date: Fri, 15 Apr 2022 21:14:59 +0700 Subject: [PATCH 3/4] Fix Helm hooks custom annotations --- charts/universal-chart/results/sample.yml | 4 ++-- charts/universal-chart/templates/helm-hooks.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/universal-chart/results/sample.yml b/charts/universal-chart/results/sample.yml index 5b42af6..9f94de6 100644 --- a/charts/universal-chart/results/sample.yml +++ b/charts/universal-chart/results/sample.yml @@ -246,9 +246,9 @@ metadata: app.kubernetes.io/instance: test app.kubernetes.io/managed-by: Helm annotations: - "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook": "pre-install,pre-upgrade" "helm.sh/hook-weight": "5" - "helm.sh/hook-delete-policy": before-hook-creation + "helm.sh/hook-delete-policy": "before-hook-creation" key: value spec: activeDeadlineSeconds: 120 diff --git a/charts/universal-chart/templates/helm-hooks.yml b/charts/universal-chart/templates/helm-hooks.yml index 41862f8..0043f2b 100644 --- a/charts/universal-chart/templates/helm-hooks.yml +++ b/charts/universal-chart/templates/helm-hooks.yml @@ -11,9 +11,9 @@ metadata: {{- with $general.labels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }} {{- with .labels }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }} annotations: - "helm.sh/hook": {{ .kind | default "pre-install,pre-upgrade" }} + "helm.sh/hook": {{ .kind | default "pre-install,pre-upgrade" | quote }} "helm.sh/hook-weight": {{ .weight | default "5" | quote }} - "helm.sh/hook-delete-policy": {{ .deletePolicy | default "before-hook-creation" }} + "helm.sh/hook-delete-policy": {{ .deletePolicy | default "before-hook-creation" | quote }} {{- include "helpers.app.genericAnnotations" $ | indent 4 }} {{- with $general.annotations }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }} {{- with .annotations }}{{- include "helpers.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}{{- end }} From 4ac553e953cbfd78cd46cf9a7ae299cbda31fc65 Mon Sep 17 00:00:00 2001 From: Evgenii Tereshkov Date: Fri, 15 Apr 2022 21:16:43 +0700 Subject: [PATCH 4/4] Update chart version and changelog --- charts/universal-chart/CHANGELOG.md | 6 ++++++ charts/universal-chart/Chart.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/universal-chart/CHANGELOG.md b/charts/universal-chart/CHANGELOG.md index d0e438e..efc7178 100644 --- a/charts/universal-chart/CHANGELOG.md +++ b/charts/universal-chart/CHANGELOG.md @@ -1,4 +1,10 @@ # Changelog +## 3.0.4 - April 15, 2022 + +* Fix Helm hooks custom annotations +* Fix Service nodePort +* Removed helm hooks annotations for PVC + ## 3.0.3 - April 14, 2022 * fix: nindent in securityContext: diff --git a/charts/universal-chart/Chart.yaml b/charts/universal-chart/Chart.yaml index 17e1b34..0e4da51 100644 --- a/charts/universal-chart/Chart.yaml +++ b/charts/universal-chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Nixys universal Helm chart for deploy your apps to Kubernetes name: universal-chart -version: 3.0.3 +version: 3.0.4 maintainers: - name: Roman Andreev email: r.andreev@nixys.ru