Skip to content
Snippets Groups Projects
Unverified Commit df9db52c authored by Comte's avatar Comte Committed by GitHub
Browse files

Merge pull request #31 from sergkudinov/main

Add routes to library-charts
parents 3faa2d73 fe14a67f
No related branches found
Tags library-chart-1.3.0
No related merge requests found
apiVersion: v2
name: library-chart
version: 1.2.3
version: 1.3.0
type: library
{{/* vim: set filetype=mustache: */}}
{{/* Route annotations */}}
{{- define "library-chart.route.annotations" -}}
{{- with .Values.route.annotations }}
{{- toYaml . }}
{{- end }}
{{- if .Values.security.allowlist.enabled }}
haproxy.router.openshift.io/ip_whitelist: {{ .Values.security.allowlist.ip }}
{{- end }}
{{- end }}
{{/* Route hostname */}}
{{- define "library-chart.route.hostname" -}}
{{- if .Values.route.generate }}
{{- printf "%s" .Values.route.userHostname }}
{{- else }}
{{- printf "%s" .Values.route.hostname }}
{{- end }}
{{- end }}
{{/* Template to generate a standard Route */}}
{{- define "library-chart.route" -}}
{{- if .Values.route.enabled -}}
{{- $fullName := include "library-chart.fullname" . -}}
{{- $svcPort := .Values.networking.service.port -}}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ $fullName }}-ui
labels:
{{- include "library-chart.labels" . | nindent 4 }}
annotations:
{{- include "library-chart.route.annotations" . | nindent 4 }}
spec:
host: {{ .Values.route.hostname | quote }}
path: /
to:
kind: Service
name: {{ $fullName }}
port:
targetPort: {{ $svcPort }}
tls:
termination: {{ .Values.route.tls.termination }}
{{- if .Values.route.tls.key }}
key: {{- .Values.route.tls.key }}
{{- end }}
{{- if .Values.route.tls.certificate }}
certificate: {{- .Values.route.tls.certificate }}
{{- end }}
{{- if .Values.route.tls.caCertificate }}
caCertificate: {{- .Values.route.tls.caCertificate }}
{{- end }}
{{- if .Values.route.tls.destinationCACertificate }}
destinationCACertificate: {{- .Values.route.tls.destinationCACertificate }}
{{- end }}
wildcardPolicy: {{ .Values.route.wildcardPolicy }}
{{- end }}
{{- end }}
{{/* Template to generate a custom Route */}}
{{- define "library-chart.routeUser" -}}
{{- if .Values.route.enabled -}}
{{ if .Values.networking.user.enabled }}
{{- $fullName := include "library-chart.fullname" . -}}
{{- $svcPort := .Values.networking.user.port -}}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ $fullName }}-user
labels:
{{- include "library-chart.labels" . | nindent 4 }}
annotations:
{{- include "library-chart.route.annotations" . | nindent 4 }}
spec:
host: {{ .Values.route.userHostname | quote }}
path: /
to:
kind: Service
name: {{ $fullName }}
port:
targetPort: {{ $svcPort }}
tls:
termination: {{ .Values.route.tls.termination }}
{{- if .Values.route.tls.key }}
key: {{- .Values.route.tls.key }}
{{- end }}
{{- if .Values.route.tls.certificate }}
certificate: {{- .Values.route.tls.certificate }}
{{- end }}
{{- if .Values.route.tls.caCertificate }}
caCertificate: {{- .Values.route.tls.caCertificate }}
{{- end }}
{{- if .Values.route.tls.destinationCACertificate }}
destinationCACertificate: {{- .Values.route.tls.destinationCACertificate }}
{{- end }}
wildcardPolicy: {{ .Values.route.wildcardPolicy }}
{{- end }}
{{- end }}
{{- end }}
{{/* Template to generate a Route for the Spark UI */}}
{{- define "library-chart.routeSpark" -}}
{{- if .Values.route.enabled -}}
{{- if .Values.spark.sparkui -}}
{{- $fullName := include "library-chart.fullname" . -}}
{{- $svcPort := .Values.networking.sparkui.port -}}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ $fullName }}-sparkui
labels:
{{- include "library-chart.labels" . | nindent 4 }}
annotations:
{{- include "library-chart.route.annotations" . | nindent 4 }}
spec:
host: {{ .Values.route.sparkHostname | quote }}
path: /
to:
kind: Service
name: {{ $fullName }}
port:
targetPort: {{ $svcPort }}
tls:
termination: {{ .Values.route.tls.termination }}
{{- if .Values.route.tls.key }}
key: {{- .Values.route.tls.key }}
{{- end }}
{{- if .Values.route.tls.certificate }}
certificate: {{- .Values.route.tls.certificate }}
{{- end }}
{{- if .Values.route.tls.caCertificate }}
caCertificate: {{- .Values.route.tls.caCertificate }}
{{- end }}
{{- if .Values.route.tls.destinationCACertificate }}
destinationCACertificate: {{- .Values.route.tls.destinationCACertificate }}
{{- end }}
wildcardPolicy: {{ .Values.route.wildcardPolicy }}
{{- end }}
{{- end }}
{{- end }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment