apiVersion: v1
kind: Service
metadata:
  name: {{ include "openshift-console-plugin.fullname" . }}
  labels:
    {{- include "openshift-console-plugin.labels" . | nindent 4 }}
  annotations:
    service.alpha.openshift.io/serving-cert-secret-name: {{ .Values.plugin.tls.certs.secretName }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: http
      protocol: TCP
      name: http
      {{- if and (eq .Values.service.type "NodePort") .Values.plugin.nodePort }}
      nodePort: {{ .Values.plugin.nodePort }}
      {{- end }}
  selector:
    {{- include "openshift-console-plugin.selectorLabels" . | nindent 4 }}
