---
apiVersion: v1
kind: Service
metadata:
  name: {{ include "hookshot.fullname" . }}
  namespace: {{ template "hookshot.namespace" . }}
{{- with .Values.service.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
  labels:
    {{- include "hookshot.labels" . | nindent 4 }}
{{- with .Values.service.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.webhook.port }}
      targetPort: webhook
      protocol: TCP
      name: webhook
    - port: {{ .Values.service.metrics.port }}
      targetPort: metrics
      protocol: TCP
      name: metrics
    - port: {{ .Values.service.appservice.port }}
      targetPort: appservice
      protocol: TCP
      name: appservice
  selector:
    {{- include "hookshot.selectorLabels" . | nindent 4 }}
