charts/unifi/templates/discovery-svc.yaml

53 lines
1.8 KiB
YAML
Raw Normal View History

2018-06-30 03:18:07 +00:00
apiVersion: v1
kind: Service
metadata:
name: {{ template "unifi.fullname" . }}-discovery
labels:
app: {{ template "unifi.name" . }}
chart: {{ template "unifi.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.discoveryService.labels }}
{{ toYaml .Values.discoveryService.labels | indent 4 }}
{{- end }}
{{- with .Values.discoveryService.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
2018-06-30 03:18:07 +00:00
spec:
{{- if (or (eq .Values.discoveryService.type "ClusterIP") (empty .Values.discoveryService.type)) }}
type: ClusterIP
{{- if .Values.discoveryService.clusterIP }}
clusterIP: {{ .Values.discoveryService.clusterIP }}
{{end}}
{{- else if eq .Values.discoveryService.type "LoadBalancer" }}
2018-06-30 03:18:07 +00:00
type: {{ .Values.discoveryService.type }}
{{- if .Values.discoveryService.loadBalancerIP }}
loadBalancerIP: {{ .Values.discoveryService.loadBalancerIP }}
{{- end }}
{{- if .Values.discoveryService.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.discoveryService.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.discoveryService.type }}
{{- end }}
{{- if .Values.discoveryService.externalIPs }}
externalIPs:
{{ toYaml .Values.discoveryService.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.discoveryService.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.discoveryService.externalTrafficPolicy }}
{{- end }}
2018-06-30 03:18:07 +00:00
ports:
- port: {{ .Values.discoveryService.port }}
targetPort: discovery
2018-06-30 03:18:07 +00:00
protocol: UDP
name: discovery
{{ if (and (eq .Values.discoveryService.type "NodePort") (not (empty .Values.discoveryService.nodePort))) }}
nodePort: {{.Values.discoveryService.nodePort}}
{{ end }}
2018-06-30 03:18:07 +00:00
selector:
app: {{ template "unifi.name" . }}
release: {{ .Release.Name }}