{{- if .Values.policies.monitoring.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "openebs.fullname" . }}-grafana-service
  labels:
    app: {{ template "openebs.name" . }}
    chart: {{ template "openebs.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  type: NodePort
  ports:
  - port: {{ .Values.grafana.ports.externalPort }}
    targetPort: {{ .Values.grafana.ports.internalPort }}
    nodePort: {{ .Values.grafana.ports.nodePort }}
  selector:
    app: {{ template "openebs.name" . }}
    release: {{ .Release.Name }}
    component: grafana
{{- end }}
