🔧(helm) create ingress_ws
The ingress was the same for the frontend, the backend and the websocket, but the websocket needs to be handled differently, so we created a new ingress specifically for the websocket.
This commit is contained in:
@@ -46,24 +46,6 @@ spec:
|
||||
- host: {{ .Values.ingress.host | quote }}
|
||||
http:
|
||||
paths:
|
||||
- path: /ws
|
||||
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
pathType: ImplementationSpecific
|
||||
{{- end }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "impress.webrtc.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.webrtc.service.port }}
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "impress.webrtc.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.webrtc.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "impress.webrtc.fullname" . }}
|
||||
servicePort: {{ .Values.webrtc.service.port }}
|
||||
{{- end }}
|
||||
- path: {{ .Values.ingress.path | quote }}
|
||||
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
pathType: Prefix
|
||||
|
||||
72
src/helm/impress/templates/ingress_ws.yaml
Normal file
72
src/helm/impress/templates/ingress_ws.yaml
Normal file
@@ -0,0 +1,72 @@
|
||||
{{- if .Values.ingressWS.enabled -}}
|
||||
{{- $fullName := include "impress.fullname" . -}}
|
||||
{{- if and .Values.ingressWS.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingressWS.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingressWS.annotations "kubernetes.io/ingress.class" .Values.ingressWS.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 }}-ws
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
{{- include "impress.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingressWS.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.ingressWS.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||
ingressClassName: {{ .Values.ingressWS.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingressWS.tls.enabled }}
|
||||
tls:
|
||||
{{- if .Values.ingressWS.host }}
|
||||
- secretName: {{ $fullName }}-tls
|
||||
hosts:
|
||||
- {{ .Values.ingressWS.host | quote }}
|
||||
{{- end }}
|
||||
{{- range .Values.ingressWS.tls.additional }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if .Values.ingressWS.host }}
|
||||
- host: {{ .Values.ingressWS.host | quote }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ .Values.ingressWS.path | quote }}
|
||||
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
pathType: ImplementationSpecific
|
||||
{{- end }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "impress.webrtc.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.webrtc.service.port }}
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "impress.webrtc.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.webrtc.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "impress.webrtc.fullname" . }}
|
||||
servicePort: {{ .Values.webrtc.service.port }}
|
||||
{{- end }}
|
||||
{{- with .Values.ingressWS.customBackends }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user