{{/*
# Copyright 2020-present Open Networking Foundation

# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
*/}}

{{- if .Values.config.pcf.deploy }}
---
apiVersion: v1
kind: Service
metadata:
  name: pcf
  labels:
{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
spec:
  type: {{ .Values.config.pcf.serviceType }}
  selector:
{{ tuple "pcf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
  ports:
  - name: sbi
    port: {{ .Values.config.pcf.sbi.port }}
    protocol: TCP
{{- if eq .Values.config.pcf.serviceType "NodePort" }}
{{- if .Values.config.pcf.sbi.nodePort }}
    nodePort: {{ .Values.config.pcf.sbi.nodePort }}
{{- end }}
{{- end }}
{{- end }}
