From cf74659034900e6a6bdb55f3da3884d05be12573 Mon Sep 17 00:00:00 2001 From: roicohen <213414225+roicohen326@users.noreply.github.com> Date: Sun, 21 Dec 2025 18:43:15 +0200 Subject: [PATCH 1/3] chore: add infra labels and annotations --- helm/Chart.yaml | 3 ++ helm/templates/_helpers.tpl | 43 +++++++++++++++++++++++ helm/templates/nginx/nginx-configmap.yaml | 5 +-- helm/values.yaml | 11 ++++++ 4 files changed, 58 insertions(+), 4 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 332e972..868614a 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -8,3 +8,6 @@ dependencies: - name: nginx version: 1.3.0 repository: oci://acrarolibotnonprod.azurecr.io/helm + - name: mclabels + version: 1.0.1 + repository: oci://acrarolibotnonprod.azurecr.io/helm/infra \ No newline at end of file diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index b2873a9..6e70b8c 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -4,3 +4,46 @@ Expand the name of the chart. {{- define "files-server.name" -}} {{- default .Chart.Name | trunc 63 | trimSuffix "-" }} {{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "files-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Returns the environment from global if exists or from the chart's values, defaults to development +*/}} +{{- define "files-server.environment" -}} +{{- if .Values.global.environment }} + {{- .Values.global.environment -}} +{{- else -}} + {{- .Values.environment | default "development" -}} +{{- end -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "files-server.labels" -}} +app.kubernetes.io/name: {{ include "files-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +helm.sh/chart: {{ include "files-server.chart" . }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/component: backend +environment: {{ include "files-server.environment" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +{{ include "mclabels.labels" . }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "files-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "files-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{ include "mclabels.selectorLabels" . }} +{{- end }} diff --git a/helm/templates/nginx/nginx-configmap.yaml b/helm/templates/nginx/nginx-configmap.yaml index 2a3efd7..e3c633c 100644 --- a/helm/templates/nginx/nginx-configmap.yaml +++ b/helm/templates/nginx/nginx-configmap.yaml @@ -7,10 +7,7 @@ kind: ConfigMap metadata: name: {{ $nginxConfigmapName }} labels: - app: {{ $releaseName }}-{{ $chartName }} - component: nginx-configmap - environment: {{ .Values.environment }} - release: {{ $releaseName }} +{{ include "files-server.labels" . | indent 4 }} data: nginx.conf: {{ tpl (.Files.Get "config/nginx.conf") . | quote }} {{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index 356b2a4..2ea0422 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -15,6 +15,17 @@ global: gpkgSubPath: "" ingress: domain: "example.com" + +mclabels: + #environment: development + component: backend + partOf: export + owner: raster + gisDomain: raster + prometheus: + enabled: true + port: 9117 + longScraping: true enabled: true environment: development From 31d338a075e56adc47059789200cd2849fd5cca8 Mon Sep 17 00:00:00 2001 From: Roi Cohen <213414225+roicohen326@users.noreply.github.com> Date: Sun, 28 Dec 2025 16:28:08 +0200 Subject: [PATCH 2/3] chore: fixed eof --- helm/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 868614a..43f1334 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -10,4 +10,4 @@ dependencies: repository: oci://acrarolibotnonprod.azurecr.io/helm - name: mclabels version: 1.0.1 - repository: oci://acrarolibotnonprod.azurecr.io/helm/infra \ No newline at end of file + repository: oci://acrarolibotnonprod.azurecr.io/helm/infra From 2565dbecd5f0354c46bbd32fa65a36416cd5b52d Mon Sep 17 00:00:00 2001 From: Roi Cohen <213414225+roicohen326@users.noreply.github.com> Date: Sun, 28 Dec 2025 16:42:24 +0200 Subject: [PATCH 3/3] choreemove longScraping option from values.yaml --- helm/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/helm/values.yaml b/helm/values.yaml index 2ea0422..6a7e3a1 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -25,7 +25,6 @@ mclabels: prometheus: enabled: true port: 9117 - longScraping: true enabled: true environment: development