diff --git a/charts/daemonset-app/Chart.yaml b/charts/daemonset-app/Chart.yaml index 48b47c49..0859f733 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.16.0 +version: 0.16.1 appVersion: latest maintainers: - name: diranged email: matt@nextdoor.com dependencies: - name: nd-common - version: 0.3.1 + version: 0.3.6 repository: file://../nd-common diff --git a/charts/daemonset-app/templates/_helpers.tpl b/charts/daemonset-app/templates/_helpers.tpl new file mode 100644 index 00000000..9ae50b4f --- /dev/null +++ b/charts/daemonset-app/templates/_helpers.tpl @@ -0,0 +1,16 @@ +{{/* +This function generates an extended set of labels by combining the base labels +from the "nd-common.labels" template with additional custom labels. + +The additional labels include: + - helm.chart/name: Specifies the name of the chart (hardcoded as "daemonset-app"). + - helm.chart/version: Includes the chart version dynamically from .Chart.Version. +*/}} +{{- define "nd-common.extendedLabels" -}} +{{- $baseLabels := include "nd-common.labels" . | fromYaml -}} +{{- $extendedLabels := merge $baseLabels (dict + "helm.chart/name" "daemonset-app" + "helm.chart/version" .Chart.Version +) -}} +{{- $extendedLabels | toYaml -}} +{{- end -}} \ No newline at end of file diff --git a/charts/daemonset-app/templates/daemonset.yaml b/charts/daemonset-app/templates/daemonset.yaml index bea2d3ae..e70da5cf 100644 --- a/charts/daemonset-app/templates/daemonset.yaml +++ b/charts/daemonset-app/templates/daemonset.yaml @@ -3,7 +3,7 @@ kind: DaemonSet metadata: name: {{ include "nd-common.fullname" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: {{- with .Values.minReadySeconds }} minReadySeconds: {{ . }} @@ -30,7 +30,7 @@ spec: {{- end }} {{- end }} labels: - {{- include "nd-common.labels" . | nindent 8 }} + {{- include "nd-common.extendedLabels" . | nindent 8 }} {{- include "nd-common.istioLabels" . | nindent 8 }} {{- with .Values.podLabels }} {{- tpl (toYaml .) $ | nindent 8 }} diff --git a/charts/daemonset-app/templates/prometheusrules.yaml b/charts/daemonset-app/templates/prometheusrules.yaml index a21488b2..d0d7287b 100644 --- a/charts/daemonset-app/templates/prometheusrules.yaml +++ b/charts/daemonset-app/templates/prometheusrules.yaml @@ -8,7 +8,7 @@ kind: PrometheusRule metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-rules labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: groups: - name: {{ .Release.Namespace }}.{{ .Release.Name }}.{{ .Chart.Name }}.PodRules diff --git a/charts/daemonset-app/templates/serviceaccount.yaml b/charts/daemonset-app/templates/serviceaccount.yaml index 9eaa14f9..264c6049 100644 --- a/charts/daemonset-app/templates/serviceaccount.yaml +++ b/charts/daemonset-app/templates/serviceaccount.yaml @@ -4,7 +4,7 @@ kind: ServiceAccount metadata: name: {{ include "nd-common.serviceAccountName" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/rollout-app/Chart.yaml b/charts/rollout-app/Chart.yaml index b86e4f5b..b84e7fdd 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.4.3 +version: 1.4.4 appVersion: latest maintainers: - name: diranged diff --git a/charts/rollout-app/templates/_helpers.tpl b/charts/rollout-app/templates/_helpers.tpl index 59036d3f..b5cb0d2c 100644 --- a/charts/rollout-app/templates/_helpers.tpl +++ b/charts/rollout-app/templates/_helpers.tpl @@ -41,3 +41,20 @@ Again, we do not use all of the values, we only use the values that make sense. name: {{ $port.name }} {{- end }} {{- end -}} + +{{/* +This function generates an extended set of labels by combining the base labels +from the "nd-common.labels" template with additional custom labels. + +The additional labels include: + - helm.chart/name: Specifies the name of the chart (hardcoded as "rollout-app"). + - helm.chart/version: Includes the chart version dynamically from .Chart.Version. +*/}} +{{- define "nd-common.extendedLabels" -}} +{{- $baseLabels := include "nd-common.labels" . | fromYaml -}} +{{- $extendedLabels := merge $baseLabels (dict + "helm.chart/name" "rollout-app" + "helm.chart/version" .Chart.Version +) -}} +{{- $extendedLabels | toYaml -}} +{{- end -}} \ No newline at end of file diff --git a/charts/rollout-app/templates/hpa.yaml b/charts/rollout-app/templates/hpa.yaml index 52cbcea6..b0c688f3 100644 --- a/charts/rollout-app/templates/hpa.yaml +++ b/charts/rollout-app/templates/hpa.yaml @@ -5,7 +5,7 @@ kind: HorizontalPodAutoscaler metadata: name: {{ include "nd-common.fullname" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: argoproj.io/v1alpha1 diff --git a/charts/rollout-app/templates/ingress/ingress.yaml b/charts/rollout-app/templates/ingress/ingress.yaml index 7d4cc1fc..1d5dae44 100644 --- a/charts/rollout-app/templates/ingress/ingress.yaml +++ b/charts/rollout-app/templates/ingress/ingress.yaml @@ -5,7 +5,7 @@ kind: Ingress metadata: name: {{ $fullName }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} annotations: {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} diff --git a/charts/rollout-app/templates/ingress/networkpolicy.yaml b/charts/rollout-app/templates/ingress/networkpolicy.yaml index ca078506..36380a5f 100644 --- a/charts/rollout-app/templates/ingress/networkpolicy.yaml +++ b/charts/rollout-app/templates/ingress/networkpolicy.yaml @@ -5,7 +5,7 @@ kind: NetworkPolicy metadata: name: {{ include "nd-common.fullname" . }}-ingress-access labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: policyTypes: [Ingress] podSelector: diff --git a/charts/rollout-app/templates/istio/networkpolicy.yaml b/charts/rollout-app/templates/istio/networkpolicy.yaml index 6a7981ce..898f9ae0 100644 --- a/charts/rollout-app/templates/istio/networkpolicy.yaml +++ b/charts/rollout-app/templates/istio/networkpolicy.yaml @@ -5,7 +5,7 @@ kind: NetworkPolicy metadata: name: {{ include "nd-common.fullname" . }}-ingressgateway-access labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: policyTypes: [Ingress] podSelector: diff --git a/charts/rollout-app/templates/istio/virtualservice.yaml b/charts/rollout-app/templates/istio/virtualservice.yaml index 4b40b432..6d55b474 100644 --- a/charts/rollout-app/templates/istio/virtualservice.yaml +++ b/charts/rollout-app/templates/istio/virtualservice.yaml @@ -6,7 +6,7 @@ kind: VirtualService metadata: name: {{ include "nd-common.fullname" $ }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} {{- with .Values.virtualService.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/rollout-app/templates/poddisruptionbudget.yaml b/charts/rollout-app/templates/poddisruptionbudget.yaml index 023f06a6..83c10522 100644 --- a/charts/rollout-app/templates/poddisruptionbudget.yaml +++ b/charts/rollout-app/templates/poddisruptionbudget.yaml @@ -4,7 +4,7 @@ kind: PodDisruptionBudget metadata: name: {{ template "nd-common.fullname" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: selector: matchLabels: diff --git a/charts/rollout-app/templates/prometheusrules.yaml b/charts/rollout-app/templates/prometheusrules.yaml index 32651e92..40a66e1c 100644 --- a/charts/rollout-app/templates/prometheusrules.yaml +++ b/charts/rollout-app/templates/prometheusrules.yaml @@ -8,7 +8,7 @@ kind: PrometheusRule metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-rules labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: groups: - name: {{ .Release.Namespace }}.{{ .Release.Name }}.{{ .Chart.Name }}.PodRules diff --git a/charts/rollout-app/templates/rollout.yaml b/charts/rollout-app/templates/rollout.yaml index dda4907c..5eadaff9 100644 --- a/charts/rollout-app/templates/rollout.yaml +++ b/charts/rollout-app/templates/rollout.yaml @@ -3,7 +3,7 @@ kind: Rollout metadata: name: {{ include "nd-common.fullname" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: {{- with .Values.minReadySeconds }} minReadySeconds: {{ . }} @@ -140,7 +140,7 @@ spec: {{- end }} {{- end }} labels: - {{- include "nd-common.labels" . | nindent 8 }} + {{- include "nd-common.extendedLabels" . | nindent 8 }} {{- include "nd-common.istioLabels" . | nindent 8 }} {{- with .Values.podLabels }} {{- tpl (toYaml .) $ | nindent 8 }} diff --git a/charts/rollout-app/templates/serviceaccount.yaml b/charts/rollout-app/templates/serviceaccount.yaml index 9eaa14f9..264c6049 100644 --- a/charts/rollout-app/templates/serviceaccount.yaml +++ b/charts/rollout-app/templates/serviceaccount.yaml @@ -4,7 +4,7 @@ kind: ServiceAccount metadata: name: {{ include "nd-common.serviceAccountName" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/rollout-app/templates/services.yaml b/charts/rollout-app/templates/services.yaml index 386b61d8..7cfe0c1d 100644 --- a/charts/rollout-app/templates/services.yaml +++ b/charts/rollout-app/templates/services.yaml @@ -9,7 +9,7 @@ kind: Service metadata: name: {{ include "nd-common.fullname" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} annotations: {{/* This is only used for type=LoadBalancer Services which run in AWS. @@ -40,7 +40,7 @@ kind: Service metadata: name: {{ include "nd-common.fullname" . }}-preview labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} annotations: {{/* This is only used for type=LoadBalancer Services which run in AWS. @@ -73,7 +73,7 @@ kind: Service metadata: name: {{ include "nd-common.fullname" . }}-canary labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} annotations: {{/* This is only used for type=LoadBalancer Services which run in AWS. diff --git a/charts/simple-app/templates/_helpers.tpl b/charts/simple-app/templates/_helpers.tpl index c88abd67..4019d8f1 100644 --- a/charts/simple-app/templates/_helpers.tpl +++ b/charts/simple-app/templates/_helpers.tpl @@ -12,10 +12,19 @@ setting. {{- end }} {{- end }} +{{/* +This function generates an extended set of labels by combining the base labels +from the "nd-common.labels" template with additional custom labels. + +The additional labels include: + - helm.chart/name: Specifies the name of the chart (hardcoded as "simple-app"). + - helm.chart/version: Includes the chart version dynamically from .Chart.Version. +*/}} {{- define "nd-common.extendedLabels" -}} {{- $baseLabels := include "nd-common.labels" . | fromYaml -}} {{- $extendedLabels := merge $baseLabels (dict - "helm.chart.simple-app/version" .Chart.Version + "helm.chart/name" "simple-app" + "helm.chart/version" .Chart.Version ) -}} {{- $extendedLabels | toYaml -}} {{- end -}} \ No newline at end of file diff --git a/charts/simple-app/templates/ingress/ingress.yaml b/charts/simple-app/templates/ingress/ingress.yaml index 7d4cc1fc..1d5dae44 100644 --- a/charts/simple-app/templates/ingress/ingress.yaml +++ b/charts/simple-app/templates/ingress/ingress.yaml @@ -5,7 +5,7 @@ kind: Ingress metadata: name: {{ $fullName }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} annotations: {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} diff --git a/charts/simple-app/templates/ingress/networkpolicy.yaml b/charts/simple-app/templates/ingress/networkpolicy.yaml index ca078506..36380a5f 100644 --- a/charts/simple-app/templates/ingress/networkpolicy.yaml +++ b/charts/simple-app/templates/ingress/networkpolicy.yaml @@ -5,7 +5,7 @@ kind: NetworkPolicy metadata: name: {{ include "nd-common.fullname" . }}-ingress-access labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: policyTypes: [Ingress] podSelector: diff --git a/charts/simple-app/templates/istio/networkpolicy.yaml b/charts/simple-app/templates/istio/networkpolicy.yaml index 6a7981ce..898f9ae0 100644 --- a/charts/simple-app/templates/istio/networkpolicy.yaml +++ b/charts/simple-app/templates/istio/networkpolicy.yaml @@ -5,7 +5,7 @@ kind: NetworkPolicy metadata: name: {{ include "nd-common.fullname" . }}-ingressgateway-access labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: policyTypes: [Ingress] podSelector: diff --git a/charts/simple-app/templates/istio/virtualservice.yaml b/charts/simple-app/templates/istio/virtualservice.yaml index 36d52155..5d361328 100644 --- a/charts/simple-app/templates/istio/virtualservice.yaml +++ b/charts/simple-app/templates/istio/virtualservice.yaml @@ -6,7 +6,7 @@ kind: VirtualService metadata: name: {{ include "nd-common.fullname" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} {{- with .Values.virtualService.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/stateful-app/Chart.yaml b/charts/stateful-app/Chart.yaml index 5fc94b8b..6d9e913a 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.4.3 +version: 1.4.4 appVersion: latest maintainers: - name: diranged diff --git a/charts/stateful-app/templates/_helpers.tpl b/charts/stateful-app/templates/_helpers.tpl index 10f876f3..3faf2e23 100644 --- a/charts/stateful-app/templates/_helpers.tpl +++ b/charts/stateful-app/templates/_helpers.tpl @@ -6,3 +6,20 @@ {{- .Values.proxySidecar.image.repository }}:{{ $tag }} {{- end }} {{- end }} + +{{/* +This function generates an extended set of labels by combining the base labels +from the "nd-common.labels" template with additional custom labels. + +The additional labels include: + - helm.chart/name: Specifies the name of the chart (hardcoded as "stateful-app"). + - helm.chart/version: Includes the chart version dynamically from .Chart.Version. +*/}} +{{- define "nd-common.extendedLabels" -}} +{{- $baseLabels := include "nd-common.labels" . | fromYaml -}} +{{- $extendedLabels := merge $baseLabels (dict + "helm.chart/name" "stateful-app" + "helm.chart/version" .Chart.Version +) -}} +{{- $extendedLabels | toYaml -}} +{{- end -}} \ No newline at end of file diff --git a/charts/stateful-app/templates/ingress/ingress.yaml b/charts/stateful-app/templates/ingress/ingress.yaml index 7d4cc1fc..1d5dae44 100644 --- a/charts/stateful-app/templates/ingress/ingress.yaml +++ b/charts/stateful-app/templates/ingress/ingress.yaml @@ -5,7 +5,7 @@ kind: Ingress metadata: name: {{ $fullName }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} annotations: {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} diff --git a/charts/stateful-app/templates/ingress/networkpolicy.yaml b/charts/stateful-app/templates/ingress/networkpolicy.yaml index ca078506..36380a5f 100644 --- a/charts/stateful-app/templates/ingress/networkpolicy.yaml +++ b/charts/stateful-app/templates/ingress/networkpolicy.yaml @@ -5,7 +5,7 @@ kind: NetworkPolicy metadata: name: {{ include "nd-common.fullname" . }}-ingress-access labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: policyTypes: [Ingress] podSelector: diff --git a/charts/stateful-app/templates/istio/networkpolicy.yaml b/charts/stateful-app/templates/istio/networkpolicy.yaml index 6a7981ce..898f9ae0 100644 --- a/charts/stateful-app/templates/istio/networkpolicy.yaml +++ b/charts/stateful-app/templates/istio/networkpolicy.yaml @@ -5,7 +5,7 @@ kind: NetworkPolicy metadata: name: {{ include "nd-common.fullname" . }}-ingressgateway-access labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: policyTypes: [Ingress] podSelector: diff --git a/charts/stateful-app/templates/istio/virtualservice.yaml b/charts/stateful-app/templates/istio/virtualservice.yaml index 75b9d255..13cf2610 100644 --- a/charts/stateful-app/templates/istio/virtualservice.yaml +++ b/charts/stateful-app/templates/istio/virtualservice.yaml @@ -6,7 +6,7 @@ kind: VirtualService metadata: name: {{ include "nd-common.fullname" $ }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} {{- with .Values.virtualService.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/stateful-app/templates/poddisruptionbudget.yaml b/charts/stateful-app/templates/poddisruptionbudget.yaml index 023f06a6..83c10522 100644 --- a/charts/stateful-app/templates/poddisruptionbudget.yaml +++ b/charts/stateful-app/templates/poddisruptionbudget.yaml @@ -4,7 +4,7 @@ kind: PodDisruptionBudget metadata: name: {{ template "nd-common.fullname" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: selector: matchLabels: diff --git a/charts/stateful-app/templates/prometheusrules.yaml b/charts/stateful-app/templates/prometheusrules.yaml index 68b63528..48690ac8 100644 --- a/charts/stateful-app/templates/prometheusrules.yaml +++ b/charts/stateful-app/templates/prometheusrules.yaml @@ -9,7 +9,7 @@ kind: PrometheusRule metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-rules labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: groups: - name: {{ .Release.Namespace }}.{{ .Release.Name }}.{{ .Chart.Name }}.PodRules diff --git a/charts/stateful-app/templates/serviceaccount.yaml b/charts/stateful-app/templates/serviceaccount.yaml index 9eaa14f9..264c6049 100644 --- a/charts/stateful-app/templates/serviceaccount.yaml +++ b/charts/stateful-app/templates/serviceaccount.yaml @@ -4,7 +4,7 @@ kind: ServiceAccount metadata: name: {{ include "nd-common.serviceAccountName" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/stateful-app/templates/statefulset.yaml b/charts/stateful-app/templates/statefulset.yaml index bf6fc0e3..a74aab34 100644 --- a/charts/stateful-app/templates/statefulset.yaml +++ b/charts/stateful-app/templates/statefulset.yaml @@ -8,7 +8,7 @@ kind: StatefulSet metadata: name: {{ include "nd-common.fullname" . }} labels: - {{- include "nd-common.labels" . | nindent 4 }} + {{- include "nd-common.extendedLabels" . | nindent 4 }} spec: {{- with .Values.podManagementPolicy }} podManagementPolicy: {{ . }} @@ -47,7 +47,7 @@ spec: {{- end }} {{- end }} labels: - {{- include "nd-common.labels" . | nindent 8 }} + {{- include "nd-common.extendedLabels" . | nindent 8 }} {{- include "nd-common.istioLabels" . | nindent 8 }} {{- with .Values.podLabels }} {{- tpl (toYaml .) $ | nindent 8 }}