istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/test/framework/components/echo/kube/templates/service.yaml (about)

     1  {{- if .ServiceAccount }}
     2  apiVersion: v1
     3  kind: ServiceAccount
     4  metadata:
     5    name: {{ .Service }}
     6  ---
     7  {{- end }}
     8  apiVersion: v1
     9  kind: Service
    10  metadata:
    11    name: {{ .Service }}
    12  {{- if .ServiceLabels }}
    13    labels:
    14      app: {{ .Service }}
    15  {{- range $name, $value := .ServiceLabels }}
    16      {{$name}}: "{{$value}}"
    17  {{- end }}
    18  {{- else}}
    19    labels:
    20      app: {{ .Service }}
    21  {{- end }}
    22  {{- if .ServiceAnnotations }}
    23    annotations:
    24  {{- range $name, $value := .ServiceAnnotations }}
    25      {{ $name }}: {{ printf "%q" $value }}
    26  {{- end }}
    27  {{- end }}
    28  spec:
    29  {{- if .IPFamilies }}
    30    ipFamilies: [ {{ .IPFamilies }} ]
    31  {{- end }}
    32  {{- if .IPFamilyPolicy }}
    33    ipFamilyPolicy: {{ .IPFamilyPolicy }}
    34  {{- end }}
    35  {{- if .Headless }}
    36    clusterIP: None
    37  {{- end }}
    38    ports:
    39  {{- range $i, $p := .ServicePorts }}
    40    - name: {{ $p.Name }}
    41      port: {{ $p.ServicePort }}
    42      targetPort: {{ $p.WorkloadPort }}
    43  {{- end }}
    44    selector:
    45      app: {{ .Service }}