charts/unifi/templates/controller-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" . }}-controller
labels:
app: {{ template "unifi.name" . }}
chart: {{ template "unifi.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.controllerService.labels }}
{{ toYaml .Values.controllerService.labels | indent 4 }}
{{- end }}
{{- with .Values.controllerService.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
2018-06-30 03:18:07 +00:00
spec:
{{- if (or (eq .Values.controllerService.type "ClusterIP") (empty .Values.controllerService.type)) }}
type: ClusterIP
{{- if .Values.controllerService.clusterIP }}
clusterIP: {{ .Values.controllerService.clusterIP }}
{{end}}
{{- else if eq .Values.controllerService.type "LoadBalancer" }}
2018-06-30 03:18:07 +00:00
type: {{ .Values.controllerService.type }}
{{- if .Values.controllerService.loadBalancerIP }}
loadBalancerIP: {{ .Values.controllerService.loadBalancerIP }}
{{- end }}
{{- if .Values.controllerService.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.controllerService.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.controllerService.type }}
{{- end }}
{{- if .Values.controllerService.externalIPs }}
externalIPs:
{{ toYaml .Values.controllerService.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.controllerService.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.controllerService.externalTrafficPolicy }}
{{- end }}
2018-06-30 03:18:07 +00:00
ports:
- port: {{ .Values.controllerService.port }}
targetPort: controller
2018-06-30 03:18:07 +00:00
protocol: TCP
name: controller
{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.nodePort))) }}
nodePort: {{.Values.controllerService.nodePort}}
{{ end }}
2018-06-30 03:18:07 +00:00
selector:
app: {{ template "unifi.name" . }}
release: {{ .Release.Name }}