From db0ffe9d78da5f136064661b95894946b9595217 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Mon, 7 Dec 2020 01:49:22 +0500 Subject: [PATCH] Allow using host network for plex --- test/plex/2.1.0/templates/deployment.yaml | 3 +++ test/plex/2.1.0/templates/service-tcp.yaml | 29 +++------------------- test/plex/2.1.0/values.yaml | 1 - 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/test/plex/2.1.0/templates/deployment.yaml b/test/plex/2.1.0/templates/deployment.yaml index 3fcabb00045..ff563fc72b1 100644 --- a/test/plex/2.1.0/templates/deployment.yaml +++ b/test/plex/2.1.0/templates/deployment.yaml @@ -85,6 +85,9 @@ spec: - name: pms protocol: TCP containerPort: 32400 + {{- if .Values.hostNetwork }} + hostPort: {{ .Values.serviceTCP.port }} + {{- end }} - name: plex-dlna protocol: TCP containerPort: 32469 diff --git a/test/plex/2.1.0/templates/service-tcp.yaml b/test/plex/2.1.0/templates/service-tcp.yaml index f8e1be4b433..97dde110aa6 100644 --- a/test/plex/2.1.0/templates/service-tcp.yaml +++ b/test/plex/2.1.0/templates/service-tcp.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.hostNetwork false }} apiVersion: v1 kind: Service metadata: @@ -12,38 +13,13 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: -{{- if (or (eq .Values.serviceTCP.type "ClusterIP") (empty .Values.serviceTCP.type)) }} - type: ClusterIP - {{- if .Values.serviceTCP.clusterIP }} - clusterIP: {{ .Values.serviceTCP.clusterIP }} - {{end}} -{{- else if eq .Values.serviceTCP.type "LoadBalancer" }} - type: {{ .Values.serviceTCP.type }} - {{- if .Values.serviceTCP.loadBalancerIP }} - loadBalancerIP: {{ .Values.serviceTCP.loadBalancerIP }} - {{- end }} - {{- if .Values.serviceTCP.loadBalancerSourceRanges }} - loadBalancerSourceRanges: -{{ toYaml .Values.serviceTCP.loadBalancerSourceRanges | indent 4 }} - {{- end -}} -{{- else }} - type: {{ .Values.serviceTCP.type }} -{{- end }} -{{- if .Values.serviceTCP.externalIPs }} - externalIPs: -{{ toYaml .Values.serviceTCP.externalIPs | indent 4 }} -{{- end }} - {{- if .Values.serviceTCP.externalTrafficPolicy }} - externalTrafficPolicy: {{ .Values.serviceTCP.externalTrafficPolicy }} - {{- end }} + type: NodePort ports: - name: pms port: {{ .Values.serviceTCP.port }} protocol: TCP targetPort: pms -{{ if (and (eq .Values.serviceTCP.type "NodePort") (not (empty .Values.serviceTCP.nodePort))) }} nodePort: {{.Values.serviceTCP.nodePort}} -{{ end }} - name: http port: 80 targetPort: pms @@ -55,3 +31,4 @@ spec: targetPort: plex-dlna selector: {{- include "plex.selectorLabels" . | nindent 4 }} +{{- end }} diff --git a/test/plex/2.1.0/values.yaml b/test/plex/2.1.0/values.yaml index 088bbfd106e..3b08f896063 100644 --- a/test/plex/2.1.0/values.yaml +++ b/test/plex/2.1.0/values.yaml @@ -68,7 +68,6 @@ securityContext: {} # runAsUser: 1000 serviceTCP: - enabled: true type: NodePort port: 32400 ## Specify the nodePort value for the LoadBalancer and NodePort service types.