From a984c2763fd5a1d9a4c15b9d3b3b933dd7d6aad0 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sat, 12 Oct 2024 09:02:35 +0200 Subject: [PATCH] add extraPorts support --- templates/deployment.yaml | 9 +++++++++ templates/service.yaml | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 2d01a57..514b78c 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -44,6 +44,15 @@ spec: - name: telnet containerPort: {{ .Values.telnetport }} protocol: TCP + {{- if .Values.service.extraPorts }} + {{- range $servicePort := .Values.service.extraPorts }} + - name: {{ $servicePort.name }} + containerPort: {{ $servicePort.targetPort }} + {{- if $servicePort.protocol }} + protocol: {{ $servicePort.protocol }} + {{- end }} + {{- end }} + livenessProbe: httpGet: path: /fhem diff --git a/templates/service.yaml b/templates/service.yaml index 365fcb7..b3bb14f 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -25,8 +25,9 @@ spec: {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http))) }} nodePort: {{ .Values.service.nodePorts.fhemweb }} {{- end }} - {{- if .Values.service.extraPorts }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }} - {{- end }} +{{- if .Values.service.extraPorts }} +{{- toYaml .Values.service.extraPorts | nindent 2 }} +{{- end }} + selector: {{- include "fhem.selectorLabels" . | nindent 4 }}