{{- if .Values.imageRenderer.enabled  }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "grafana.fullname" . }}-image-renderer
  namespace: {{ .Release.Namespace }}
  labels: {{- include "grafana.labels" . | nindent 4 }}
    app.kubernetes.io/component: image-renderer
  {{- if and .Values.imageRenderer.metrics.enabled .Values.imageRenderer.metrics.annotations }}
  annotations: {{- include "grafana.tplValue" (dict "value" .Values.imageRenderer.metrics.annotations "context" $) | nindent 4 }}
  {{- end }}
spec:
  type: ClusterIP
  ports:
    - port: {{ .Values.imageRenderer.service.port }}
      targetPort: http
      protocol: TCP
      name: http
  selector: {{- include "grafana.matchLabels" . | nindent 4 }}
    app.kubernetes.io/component: image-renderer
{{- end }}
