apiVersion: v1
kind: Service
metadata:
  name: {{ include "beszel.fullname" . }}
  labels:
    {{- include "beszel.labels" . | nindent 4 }}
{{- if .Values.service.annotations }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: http
      protocol: TCP
      name: http
  {{- if .Values.service.loadBalancerIP }}
  loadBalancerIP: {{ .Values.service.loadBalancerIP }}
  {{- end }}
  selector:
    {{- include "beszel.selectorLabels" . | nindent 4 }}
