{{- if .Values.imageRenderer.enabled  }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "common.names.fullname" . }}-image-renderer
  namespace: {{ .Release.Namespace }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    app.kubernetes.io/component: image-renderer
  {{- if and .Values.imageRenderer.metrics.enabled .Values.imageRenderer.metrics.annotations }}
  annotations: {{- include "common.tplvalues.render" (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 "common.labels.matchLabels" . | nindent 4 }}
    app.kubernetes.io/component: image-renderer
{{- end }}
