apiVersion: v1
kind: Service
metadata:
  name: {{ include "pinepods.fullname" . }}
  labels:
    {{- include "pinepods.labels" . | nindent 4 }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: {{ .Values.service.port }}
      {{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }}
      nodePort: {{ .Values.service.nodePort }}
      {{- end }}
  selector:
    {{- include "pinepods.selectorLabels" . | nindent 4 }}
    app.kubernetes.io/component: main
