-
Notifications
You must be signed in to change notification settings - Fork 25
/
tonic-web-server-service.yaml
39 lines (39 loc) · 1.26 KB
/
tonic-web-server-service.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{{- $server := .Values.tonicai.web_server -}}
{{- $ports := fromYaml (include "tonic.ports" (list $ $server.ports (dict "httpsOnly" true))) }}
{{- $annotations := dict }}
{{- if ((.Values.tonicai).web_server).annotations }}
{{- $annotations = .Values.tonicai.web_server.annotations }}
{{- else }}
{{- $annotations = (dict
"service.beta.kubernetes.io/aws-load-balancer-internal" "true"
"service.beta.kubernetes.io/aws-load-balancer-nlb-target-type" "ip"
"service.beta.kubernetes.io/aws-load-balancer-scheme" "internal"
"service.beta.kubernetes.io/aws-load-balancer-type" "nlb"
"service.beta.kubernetes.io/azure-load-balancer-internal" "true"
)}}
{{- end }}
{{- $serviceType := include "tonic.web.serviceType" (list $) }}
apiVersion: v1
kind: Service
metadata:
name: tonic-web-server
namespace: {{ .Release.Namespace }}
annotations:
{{- include "tonic.annotations" (list $ $annotations) | nindent 4 }}
labels:
{{- include "tonic.allLabels" (list $ (dict "app" "tonic-web-server")) | nindent 4 }}
spec:
ports:
{{- if not $ports.httpsOnly }}
- name: "http"
port: 80
targetPort: http
{{- end }}
- name: "https"
port: 443
targetPort: https
type: {{ $serviceType }}
selector:
app: tonic-web-server
status:
loadBalancer: {}