From 107e53d3b76476001b3b7917a9386948d0c74ee6 Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Sat, 5 Sep 2020 19:49:12 -0500 Subject: [PATCH] add extra ingress option for apis and test ct-values.yaml --- charts/media-common/ci/ct-values.yaml | 7 ++++ charts/media-common/templates/ingress.yaml | 42 +++++++++++++++++++++- charts/media-common/values.yaml | 15 ++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 charts/media-common/ci/ct-values.yaml diff --git a/charts/media-common/ci/ct-values.yaml b/charts/media-common/ci/ct-values.yaml new file mode 100644 index 00000000..c8ca49f7 --- /dev/null +++ b/charts/media-common/ci/ct-values.yaml @@ -0,0 +1,7 @@ +image: + organization: itscontained + repository: radarr + pullPolicy: IfNotPresent + tag: latest +service: + port: 7878 \ No newline at end of file diff --git a/charts/media-common/templates/ingress.yaml b/charts/media-common/templates/ingress.yaml index dd8fbc0a..61a29ce6 100644 --- a/charts/media-common/templates/ingress.yaml +++ b/charts/media-common/templates/ingress.yaml @@ -38,4 +38,44 @@ spec: servicePort: {{ $svcPort }} {{- end }} {{- end }} -{{- end }} + {{- range $index, $ingress := .Values.ingress.extraIngresses }} +--- + {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 + {{- else -}} +apiVersion: extensions/v1beta1 + {{- end }} +kind: Ingress +metadata: + name: {{ $fullName }}-{{ $ingress.nameSuffix | default $index }} + labels: + {{- include "media-common.labels" . | nindent 4 }} + {{- with $ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if $ingress.tls }} + tls: + {{- range $ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range $ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/media-common/values.yaml b/charts/media-common/values.yaml index 8badab61..2eab8010 100644 --- a/charts/media-common/values.yaml +++ b/charts/media-common/values.yaml @@ -53,6 +53,21 @@ ingress: # - secretName: chart-example-tls # hosts: # - chart-example.local + extraIngresses: + # - enabled: false + # nameSuffix: "api" + # annotations: {} + # # kubernetes.io/ingress.class: nginx + # # kubernetes.io/tls-acme: "true" + # labels: {} + # hosts: + # - host: chart-example.local + # paths: + # - /api + # tls: [] + # # - secretName: chart-example-tls + # # hosts: + # # - chart-example.local persistence: # type: options are statefulset or deployment