From 50354ed8355d6e6b1bd5e30c4dcf57a0d6e0ae5c Mon Sep 17 00:00:00 2001 From: "v.oleynikov" Date: Tue, 13 Jan 2026 20:43:30 +0300 Subject: [PATCH] feat(_module_controller): add controllerMetricsPort parameter Add optional controllerMetricsPort parameter to helm_lib_module_controller_manifests template for exposing metrics port in controller container. Usage: $config := dict "controllerMetricsPort" 8080 ... --- charts/helm_lib/Chart.yaml | 2 +- charts/helm_lib/templates/_module_controller.tpl | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/helm_lib/Chart.yaml b/charts/helm_lib/Chart.yaml index 5f7ea4e..cc043e7 100644 --- a/charts/helm_lib/Chart.yaml +++ b/charts/helm_lib/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 type: library name: deckhouse_lib_helm -version: 1.69.0 +version: 1.69.1 description: "Helm utils template definitions for Deckhouse modules." diff --git a/charts/helm_lib/templates/_module_controller.tpl b/charts/helm_lib/templates/_module_controller.tpl index e09c709..e4282a7 100644 --- a/charts/helm_lib/templates/_module_controller.tpl +++ b/charts/helm_lib/templates/_module_controller.tpl @@ -40,6 +40,7 @@ memory: 50Mi - webhooksCertMountPath: mount path for webhook certs (default: "/etc/webhook/certs") - webhooksCommand: command for webhooks container - controllerPort: port for controller probes (default: 8081) + - controllerMetricsPort: port for controller metrics (optional, no port exposed if not set) */ -}} {{- define "helm_lib_module_controller_manifests" }} {{- $context := index . 0 }} @@ -68,6 +69,7 @@ memory: 50Mi {{- $webhooksCertMountPath := $config.webhooksCertMountPath | default "/etc/webhook/certs" }} {{- $webhooksCommand := $config.webhooksCommand }} {{- $controllerPort := $config.controllerPort | default 8081 }} + {{- $controllerMetricsPort := $config.controllerMetricsPort }} {{- /* Get module values */ -}} {{- $moduleValues := index $context.Values $valuesKey }} @@ -195,6 +197,12 @@ spec: scheme: HTTP periodSeconds: 1 failureThreshold: 3 + {{- if $controllerMetricsPort }} + ports: + - name: metrics + containerPort: {{ $controllerMetricsPort }} + protocol: TCP + {{- end }} resources: requests: {{- include "helm_lib_module_ephemeral_storage_only_logs" $context | nindent 14 }}