Skip to content

Commit

Permalink
update labels for all apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudeng committed Dec 2, 2024
1 parent 2434c02 commit 04c3fd9
Show file tree
Hide file tree
Showing 32 changed files with 94 additions and 35 deletions.
4 changes: 2 additions & 2 deletions charts/daemonset-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
dependencies:
- name: nd-common
version: 0.3.1
version: 0.3.6
repository: file://../nd-common
16 changes: 16 additions & 0 deletions charts/daemonset-app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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 -}}
4 changes: 2 additions & 2 deletions charts/daemonset-app/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {{ . }}
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/daemonset-app/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/daemonset-app/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions charts/rollout-app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/ingress/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/ingress/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/istio/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/istio/virtualservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/rollout-app/templates/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {{ . }}
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rollout-app/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/rollout-app/templates/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 10 additions & 1 deletion charts/simple-app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
2 changes: 1 addition & 1 deletion charts/simple-app/templates/ingress/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-app/templates/ingress/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-app/templates/istio/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-app/templates/istio/virtualservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions charts/stateful-app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
2 changes: 1 addition & 1 deletion charts/stateful-app/templates/ingress/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/templates/ingress/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/templates/istio/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/templates/istio/virtualservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/stateful-app/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/stateful-app/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {{ . }}
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 04c3fd9

Please sign in to comment.