diff --git a/charts/helm_lib/Chart.yaml b/charts/helm_lib/Chart.yaml index cc043e7..3eefefc 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.1 +version: 1.69.2 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 e4282a7..3e85539 100644 --- a/charts/helm_lib/templates/_module_controller.tpl +++ b/charts/helm_lib/templates/_module_controller.tpl @@ -315,6 +315,11 @@ spec: - fullname: name of the service (default: "webhooks") - selectorApp: app label for selector (default: "controller") - targetPort: target port name or number (default: "https") + - additionalPorts: list of additional ports (optional), each port is a dict with: + - name: port name (required) + - port: service port (required) + - targetPort: target port name or number (required) + - protocol: protocol (default: "TCP") */ -}} {{- define "helm_lib_module_webhook_service" }} {{- $context := index . 0 }} @@ -323,6 +328,7 @@ spec: {{- $fullname := $config.fullname | default "webhooks" }} {{- $selectorApp := $config.selectorApp | default "controller" }} {{- $targetPort := $config.targetPort | default "https" }} + {{- $additionalPorts := $config.additionalPorts }} --- apiVersion: v1 kind: Service @@ -337,6 +343,12 @@ spec: targetPort: {{ $targetPort }} protocol: TCP name: https + {{- range $additionalPorts }} + - name: {{ .name }} + port: {{ .port }} + targetPort: {{ .targetPort }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} selector: app: {{ $selectorApp }} {{- end }}