From 1d22c4c3e108387f50fc2cb419b91e76d08eb69b Mon Sep 17 00:00:00 2001 From: Jeff Billimek Date: Thu, 20 Dec 2018 14:55:05 -0500 Subject: [PATCH] updating nzbget to support better service annotations --- nzbget/Chart.yaml | 4 ++-- nzbget/templates/service.yaml | 42 +++++++++++++++++++++++++++++++---- nzbget/values.yaml | 2 +- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/nzbget/Chart.yaml b/nzbget/Chart.yaml index 30da5de0..fc681f5c 100644 --- a/nzbget/Chart.yaml +++ b/nzbget/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -appVersion: 147 +appVersion: 153 description: NZBGet is a Usenet downloader client name: nzbget -version: 0.1.3 +version: 0.1.4 keywords: - nzbget - usenet diff --git a/nzbget/templates/service.yaml b/nzbget/templates/service.yaml index cfe565c2..f084de72 100644 --- a/nzbget/templates/service.yaml +++ b/nzbget/templates/service.yaml @@ -1,19 +1,53 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "nzbget.fullname" . }} + name: {{ template "nzbget.fullname" . }} labels: app.kubernetes.io/name: {{ include "nzbget.name" . }} helm.sh/chart: {{ include "nzbget.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.service.labels }} +{{ toYaml .Values.service.labels | indent 4 }} +{{- end }} +{{- with .Values.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: +{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }} + type: ClusterIP + {{- if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} + {{end}} +{{- else if eq .Values.service.type "LoadBalancer" }} type: {{ .Values.service.type }} + {{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} + {{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: +{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }} + {{- end -}} +{{- else }} + type: {{ .Values.service.type }} +{{- end }} +{{- if .Values.service.externalIPs }} + externalIPs: +{{ toYaml .Values.service.externalIPs | indent 4 }} +{{- end }} + {{- if .Values.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} + {{- end }} ports: - - port: {{ .Values.service.port }} - targetPort: http + - name: http + port: {{ .Values.service.port }} protocol: TCP - name: http + targetPort: http +{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} + nodePort: {{.Values.service.nodePort}} +{{ end }} selector: app.kubernetes.io/name: {{ include "nzbget.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} + \ No newline at end of file diff --git a/nzbget/values.yaml b/nzbget/values.yaml index e740d44c..d9c4a205 100644 --- a/nzbget/values.yaml +++ b/nzbget/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: repository: linuxserver/nzbget - tag: 147 + tag: 153 pullPolicy: IfNotPresent nameOverride: ""