apiVersion: v1
kind: Service
metadata:
  name: {{ template "fullname" . }}
  labels:
    app: {{ template "fullname" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
    component: core
spec:
  type: {{ .Values.service.type }}
  ports:
    - name: anchore-external-api
      port: {{ .Values.service.ports.api }}
      targetPort: {{ .Values.service.ports.api }}
      protocol: TCP
    - name: anchore-kubewebhook
      port: {{ .Values.service.ports.k8sImagePolicyWebhook }}
      targetPort: {{ .Values.service.ports.k8sImagePolicyWebhook }}
      protocol: TCP
    - name: anchore-queue
      port: {{ .Values.service.ports.queue }}
      targetPort: {{ .Values.service.ports.queue }}
      protocol: TCP
    - name: anchore-catalog
      port: {{ .Values.service.ports.catalog }}
      targetPort: {{ .Values.service.ports.catalog }}
      protocol: TCP
    - name: anchore-policy
      port: {{ .Values.service.ports.policy }}
      targetPort: {{ .Values.service.ports.policy }}
      protocol: TCP
  selector:
    app: {{ template "fullname" . }}
    component: core
