diff --git a/k8s/apps/videohosting/templates/sts-linuxservices.yaml b/k8s/apps/videohosting/templates/sts-linuxservices.yaml index bea6179..82c114b 100644 --- a/k8s/apps/videohosting/templates/sts-linuxservices.yaml +++ b/k8s/apps/videohosting/templates/sts-linuxservices.yaml @@ -28,12 +28,14 @@ spec: name: "{{ $portName }}" protocol: TCP {{ end }} + {{- if $v.ports.udp -}} {{ range $portName, $portValue := $v.ports.udp }} - port: {{ $portValue }} targetPort: {{ $portValue }} name: "{{ $portName }}-udp" protocol: UDP {{ end }} + {{- end -}} --- apiVersion: apps/v1 kind: StatefulSet @@ -82,10 +84,12 @@ spec: - containerPort: {{ $portValue }} protocol: TCP {{ end }} + {{- if $v.ports.udp -}} {{ range $portName, $portValue := $v.ports.udp }} - containerPort: {{ $portValue }} protocol: UDP {{ end }} + {{ end }} volumeMounts: - name: config mountPath: /config