{{- range .Values.controllers }}
{{- if dig "gateway" "enabled" $.Values.controllerDefaults.gateway.enabled . }}
---
apiVersion: v1
kind: Service
metadata:
  name: probe-{{.link.ref.name}}
  namespace: {{ $.Release.Namespace }}
  annotations:
    {{ include "partials.annotations.created-by" $ }}
  labels:
    linkerd.io/extension: multicluster
    mirror.linkerd.io/mirrored-gateway: "true"
    mirror.linkerd.io/cluster-name: {{.link.ref.name}}
    {{- with $.Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
spec:
  ports:
  - name: mc-probe
    port: {{ dig "gateway" "probe" "port" $.Values.controllerDefaults.gateway.probe.port . }}
    protocol: TCP
{{ end -}}
{{ end -}}
