From 316384f618d5feabeabe6c7c64d7387d60837112 Mon Sep 17 00:00:00 2001 From: Shalom Cohen <148815688+scohen-nd@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:06:18 -0500 Subject: [PATCH] fix(charts/nd-common): Fix missing layout structure for sidecar resources layout (#257) - Fix missing layout structure for sidecar resources layout. - Restructuring a cleaner template where the default values are in the values file instead of the code. - Update other charts to point to the updated nd-common. --- charts/daemonset-app/Chart.yaml | 4 ++-- charts/daemonset-app/README.md | 2 +- charts/nd-common/Chart.yaml | 2 +- charts/nd-common/README.md | 2 +- charts/nd-common/templates/_istio.tpl | 10 ++++++---- charts/rollout-app/Chart.yaml | 4 ++-- charts/rollout-app/README.md | 4 ++-- charts/simple-app/Chart.yaml | 4 ++-- charts/simple-app/README.md | 4 ++-- charts/stateful-app/Chart.yaml | 4 ++-- charts/stateful-app/README.md | 4 ++-- 11 files changed, 23 insertions(+), 21 deletions(-) diff --git a/charts/daemonset-app/Chart.yaml b/charts/daemonset-app/Chart.yaml index 9958462f..d62823cf 100644 --- a/charts/daemonset-app/Chart.yaml +++ b/charts/daemonset-app/Chart.yaml @@ -2,12 +2,12 @@ apiVersion: v2 name: daemonset-app description: Default DaemonSet Helm Chart type: application -version: 0.15.1 +version: 0.15.2 appVersion: latest maintainers: - name: diranged email: matt@nextdoor.com dependencies: - name: nd-common - version: 0.3.0 + version: 0.3.1 repository: file://../nd-common diff --git a/charts/daemonset-app/README.md b/charts/daemonset-app/README.md index 31a01752..4054e5e8 100644 --- a/charts/daemonset-app/README.md +++ b/charts/daemonset-app/README.md @@ -2,7 +2,7 @@ Default DaemonSet Helm Chart -![Version: 0.15.1](https://img.shields.io/badge/Version-0.15.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: 0.15.2](https://img.shields.io/badge/Version-0.15.2-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/ diff --git a/charts/nd-common/Chart.yaml b/charts/nd-common/Chart.yaml index 24a45ff4..0a7b6342 100644 --- a/charts/nd-common/Chart.yaml +++ b/charts/nd-common/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: nd-common description: A helper chart used by most of our other charts type: library -version: 0.3.0 +version: 0.3.1 appVersion: latest diff --git a/charts/nd-common/README.md b/charts/nd-common/README.md index 4952cb18..5641afeb 100644 --- a/charts/nd-common/README.md +++ b/charts/nd-common/README.md @@ -2,7 +2,7 @@ A helper chart used by most of our other charts -![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 0.3.1](https://img.shields.io/badge/Version-0.3.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) **This chart is a [Library Chart](https://helm.sh/docs/topics/library_charts/)** - this means that the chart itself deploys no resources, and has no `.yaml` diff --git a/charts/nd-common/templates/_istio.tpl b/charts/nd-common/templates/_istio.tpl index 6b3a5469..501320fd 100644 --- a/charts/nd-common/templates/_istio.tpl +++ b/charts/nd-common/templates/_istio.tpl @@ -102,10 +102,12 @@ Usage: To setup the values follow the regular k8s resources structure under the memory: 60Mi */ -}} {{- with .Values.istio.resources }} -sidecar.istio.io/proxyCPU: {{ .requests.cpu | default "100m" | quote }} -sidecar.istio.io/proxyCPULimit: {{ .limits.cpu | default "2" | quote }} -sidecar.istio.io/proxyMemory: {{ .requests.memory | default "128Mi" | quote }} -sidecar.istio.io/proxyMemoryLimit: {{ .limits.memory | default "1Gi" | quote }} +{{- $requests := default (dict "empty" "dict") .requests }} +{{- $limits := default (dict "empty" "dict") .limits }} +sidecar.istio.io/proxyCPU: {{ $requests.cpu | default "100m" | quote }} +sidecar.istio.io/proxyMemory: {{ $requests.memory | default "128Mi" | quote }} +sidecar.istio.io/proxyCPULimit: {{ $limits.cpu | default "2" | quote }} +sidecar.istio.io/proxyMemoryLimit: {{ $limits.memory | default "1Gi" | quote }} {{- end }} {{- end }} diff --git a/charts/rollout-app/Chart.yaml b/charts/rollout-app/Chart.yaml index 8c1804c4..48908b7c 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: 0.7.1 +version: 0.7.2 appVersion: latest maintainers: - name: diranged @@ -13,5 +13,5 @@ dependencies: repository: https://k8s-charts.nextdoor.com condition: istio-alerts.enabled - name: nd-common - version: 0.3.0 + version: 0.3.1 repository: file://../nd-common diff --git a/charts/rollout-app/README.md b/charts/rollout-app/README.md index 8fad1557..dd3c221e 100644 --- a/charts/rollout-app/README.md +++ b/charts/rollout-app/README.md @@ -2,7 +2,7 @@ Argo Rollout-based Application Helm Chart -![Version: 0.7.1](https://img.shields.io/badge/Version-0.7.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: 0.7.2](https://img.shields.io/badge/Version-0.7.2-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/ @@ -167,7 +167,7 @@ kmsSecretsRegion: us-west-2 (AWS region where the KMS key is located) | Repository | Name | Version | |------------|------|---------| -| file://../nd-common | nd-common | 0.3.0 | +| file://../nd-common | nd-common | 0.3.1 | | https://k8s-charts.nextdoor.com | istio-alerts | 0.2.0 | ## Values diff --git a/charts/simple-app/Chart.yaml b/charts/simple-app/Chart.yaml index 36687b71..e4f2b62f 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.6.1 +version: 1.6.2 appVersion: latest maintainers: - name: diranged @@ -13,5 +13,5 @@ dependencies: repository: https://k8s-charts.nextdoor.com condition: istio-alerts.enabled - name: nd-common - version: 0.3.0 + version: 0.3.1 repository: file://../nd-common diff --git a/charts/simple-app/README.md b/charts/simple-app/README.md index 6161abe2..80948a76 100644 --- a/charts/simple-app/README.md +++ b/charts/simple-app/README.md @@ -2,7 +2,7 @@ Default Microservice Helm Chart -![Version: 1.6.1](https://img.shields.io/badge/Version-1.6.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.6.2](https://img.shields.io/badge/Version-1.6.2-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/ @@ -312,7 +312,7 @@ kmsSecretsRegion: us-west-2 (AWS region where the KMS key is located) | Repository | Name | Version | |------------|------|---------| -| file://../nd-common | nd-common | 0.3.0 | +| file://../nd-common | nd-common | 0.3.1 | | https://k8s-charts.nextdoor.com | istio-alerts | 0.2.0 | ## Values diff --git a/charts/stateful-app/Chart.yaml b/charts/stateful-app/Chart.yaml index 04afa005..034b51eb 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: 0.16.1 +version: 0.16.2 appVersion: latest maintainers: - name: diranged @@ -13,5 +13,5 @@ dependencies: repository: https://k8s-charts.nextdoor.com condition: istio-alerts.enabled - name: nd-common - version: 0.3.0 + version: 0.3.1 repository: file://../nd-common diff --git a/charts/stateful-app/README.md b/charts/stateful-app/README.md index c69a39c8..e8aa25b1 100644 --- a/charts/stateful-app/README.md +++ b/charts/stateful-app/README.md @@ -2,7 +2,7 @@ Default StatefulSet Helm Chart -![Version: 0.16.1](https://img.shields.io/badge/Version-0.16.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: 0.16.2](https://img.shields.io/badge/Version-0.16.2-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/ @@ -259,7 +259,7 @@ kmsSecretsRegion: us-west-2 (AWS region where the KMS key is located) | Repository | Name | Version | |------------|------|---------| -| file://../nd-common | nd-common | 0.3.0 | +| file://../nd-common | nd-common | 0.3.1 | | https://k8s-charts.nextdoor.com | istio-alerts | 0.2.0 | ## Values