49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
{{- range $protocol := list "tcp" "udp" }}
|
|
{{- $protocolAnnotations := ternary $.Values.service.tcpAnnotations $.Values.service.udpAnnotations (eq $protocol "tcp") }}
|
|
{{- $annotations := merge (dict) $.Values.service.commonAnnotations $protocolAnnotations }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: coturn-{{ $protocol }}
|
|
labels:
|
|
app.kubernetes.io/name: coturn
|
|
app.kubernetes.io/instance: coturn
|
|
{{- with $annotations }}
|
|
annotations: {{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
type: LoadBalancer
|
|
{{- with $.Values.service.loadBalancerIP }}
|
|
loadBalancerIP: {{ . }}
|
|
{{- end }}
|
|
externalTrafficPolicy: Local
|
|
selector:
|
|
app.kubernetes.io/name: coturn
|
|
app.kubernetes.io/instance: coturn
|
|
ports:
|
|
- {name: "{{ $protocol }}", port: 3478, targetPort: "{{ $protocol }}", protocol: "{{ upper $protocol }}"}
|
|
- {name: "{{ $protocol }}-tls", port: 5349, targetPort: "{{ $protocol }}-tls", protocol: "{{ upper $protocol }}"}
|
|
---
|
|
{{- end }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: coturn-relay
|
|
{{- $relayAnnotations := merge (dict) .Values.service.commonAnnotations .Values.service.relayAnnotations }}
|
|
{{- with $relayAnnotations }}
|
|
annotations: {{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
type: LoadBalancer
|
|
{{- with .Values.service.loadBalancerIP }}
|
|
loadBalancerIP: {{ . }}
|
|
{{- end }}
|
|
externalTrafficPolicy: Local
|
|
selector:
|
|
app.kubernetes.io/name: coturn
|
|
app.kubernetes.io/instance: coturn
|
|
ports:
|
|
{{- range $port := untilStep (int .Values.relay.minPort) (int (add1 .Values.relay.maxPort)) 1 }}
|
|
- {name: "relay-{{ $port }}", port: {{ $port }}, targetPort: {{ $port }}, protocol: UDP}
|
|
{{- end }}
|