/
service.yaml
75 lines (73 loc) · 1.93 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{{- if ne .Values.service.deployment "none" }}
{{/*
#
# Deploy a k8s Service for {{ template "base.name.release" . }}
# routing to all pods that are labeled with:
# app: {{ template "base.name.chart" . }}
# routed_via: {{ .Release.Name }}
#
*/}}
{{ if .Values.mesh.enabled }}
{{ include "mesh.service" . }}
{{- else }}
{{/*
# Only enable the main app http port if we are not using TLS.
# https://phabricator.wikimedia.org/T255871
*/}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "base.name.release" . }}-http-service
labels:
app: {{ template "base.name.chart" . }}
chart: {{ template "base.name.chartid" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: NodePort
selector:
app: {{ .Values.main_app.name }}
routed_via: {{ .Release.Name }}
ports:
- name: {{ .Values.main_app.name }}-http
protocol: TCP
port: {{ .Values.app.port }}
{{/* If the port is passed as a value use it, otherwise autoallocate */}}
{{- if .Values.service.port -}}
nodePort: {{ .Values.service.port }}
{{- end }}
{{- end }}
{{- if .Values.debug_mode_enabled | default false }}
---
# debug_mode_enabled is true. Allow connections to Node Inspector.
apiVersion: v1
kind: Service
metadata:
name: {{ template "base.name.release" . }}-debug-service
labels:
app: {{ template "base.name.chart" . }}
chart: {{ template "base.name.chartid" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: NodePort
selector:
app: {{ template "base.name.chart" . }}
release: {{ .Release.Name }}
- name: node-inspector-master
protocol: TCP
port: 9229
nodePort: 31229
- name: node-inspector-worker
protocol: TCP
port: 9230
nodePort: 31230
{{- end }}
{{- else }}
{{/*
#
# Skipping deployment of k8s Service for {{ template "base.name.release" . }}
# as service.deployment is set to "{{ .Values.service.deployment }}"
#
*/}}
{{- end }}