33 lines
1.4 KiB
YAML
33 lines
1.4 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "fhem.fullname" . }}
|
|
labels:
|
|
{{- include "fhem.labels" . | nindent 4 }}
|
|
spec:
|
|
type: {{ .Values.service.type }}
|
|
{{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP)) }}
|
|
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
|
{{- end }}
|
|
{{- if or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort") }}
|
|
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
|
|
{{- end }}
|
|
{{- if and .Values.service.clusterIP (eq .Values.service.type "ClusterIP") }}
|
|
clusterIP: {{ .Values.service.clusterIP }}
|
|
{{- end }}
|
|
{{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges)) }}
|
|
loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }}
|
|
{{- end }}
|
|
ports:
|
|
- name: fhemweb
|
|
port: {{ .Values.service.ports.fhemweb }}
|
|
targetPort: {{ .Values.containerPorts.fhemweb }}
|
|
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http))) }}
|
|
nodePort: {{ .Values.service.nodePorts.fhemweb }}
|
|
{{- end }}
|
|
{{- if .Values.service.extraPorts }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
selector:
|
|
{{- include "fhem.selectorLabels" . | nindent 4 }}
|