Closes #890 Remove the service blocks outside the conditionals in the collaboration API and WS templates. Signed-off-by: Richard Jones <rich@linuxplicable.org>
68 lines
2.7 KiB
YAML
68 lines
2.7 KiB
YAML
{{- if .Values.ingressCollaborationApi.enabled -}}
|
|
{{- $fullName := include "impress.fullname" . -}}
|
|
{{- if and .Values.ingressCollaborationApi.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
|
{{- if not (hasKey .Values.ingressCollaborationApi.annotations "kubernetes.io/ingress.class") }}
|
|
{{- $_ := set .Values.ingressCollaborationApi.annotations "kubernetes.io/ingress.class" .Values.ingressCollaborationApi.className}}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
|
apiVersion: networking.k8s.io/v1
|
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
{{- else -}}
|
|
apiVersion: extensions/v1beta1
|
|
{{- end }}
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ $fullName }}-collaboration-api
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
labels:
|
|
{{- include "impress.labels" . | nindent 4 }}
|
|
{{- with .Values.ingressCollaborationApi.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if and .Values.ingressCollaborationApi.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
|
ingressClassName: {{ .Values.ingressCollaborationApi.className }}
|
|
{{- end }}
|
|
{{- if .Values.ingressCollaborationApi.tls.enabled }}
|
|
tls:
|
|
{{- if .Values.ingressCollaborationApi.host }}
|
|
- secretName: {{ .Values.ingressCollaborationApi.tls.secretName | default (printf "%s-tls" $fullName) | quote }}
|
|
hosts:
|
|
- {{ .Values.ingressCollaborationApi.host | quote }}
|
|
{{- end }}
|
|
{{- range .Values.ingressCollaborationApi.tls.additional }}
|
|
- hosts:
|
|
{{- range .hosts }}
|
|
- {{ . | quote }}
|
|
{{- end }}
|
|
secretName: {{ .secretName }}
|
|
{{- end }}
|
|
{{- end }}
|
|
rules:
|
|
{{- if .Values.ingressCollaborationApi.host }}
|
|
- host: {{ .Values.ingressCollaborationApi.host | quote }}
|
|
http:
|
|
paths:
|
|
- path: {{ .Values.ingressCollaborationApi.path | quote }}
|
|
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
pathType: ImplementationSpecific
|
|
{{- end }}
|
|
backend:
|
|
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
service:
|
|
name: {{ include "impress.yProvider.fullname" . }}
|
|
port:
|
|
number: {{ .Values.yProvider.service.port }}
|
|
{{- else }}
|
|
serviceName: {{ include "impress.yProvider.fullname" . }}
|
|
servicePort: {{ .Values.yProvider.service.port }}
|
|
{{- end }}
|
|
{{- with .Values.ingressCollaborationApi.customBackends }}
|
|
{{- toYaml . | nindent 10 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|