istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/config/analysis/analyzers/testdata/service-port-name.yaml (about)

     1  # If port is unnamed or port name doesn't follow <protocol>[-<suffix>], the analyzer will report warning.
     2  apiVersion: v1
     3  kind: Service
     4  metadata:
     5    name: my-service
     6    namespace: my-namespace
     7  spec:
     8    selector:
     9      app: my-service
    10    ports:
    11    - name: tcp-foo
    12      protocol: TCP
    13      port: 8080
    14      targetPort: 8080
    15  ---
    16  # internal waypoint, should not generate warning
    17  apiVersion: v1
    18  kind: Service
    19  metadata:
    20    labels:
    21      gateway.istio.io/managed: istio.io-mesh-controller
    22    name: reviews-istio-waypoint
    23    namespace: ambient
    24  spec:
    25    ports:
    26    - appProtocol: tcp
    27      name: status-port
    28      port: 15021
    29      protocol: TCP
    30      targetPort: 15021
    31    - appProtocol: hbone
    32      name: mesh
    33      port: 15008
    34      protocol: TCP
    35      targetPort: 15008
    36    selector:
    37      gateway.networking.k8s.io/gateway-name: reviews
    38    sessionAffinity: None
    39    type: ClusterIP
    40  ---
    41  # managed gateway, should not generate warning
    42  apiVersion: v1
    43  kind: Service
    44  metadata:
    45    annotations:
    46      test: test
    47    labels:
    48      gateway.istio.io/managed: istio.io-gateway-controller
    49    name: gateway-istio
    50    namespace: istio-ingress
    51  spec:
    52    ports:
    53    - appProtocol: tcp
    54      name: status-port
    55      nodePort: 32481
    56      port: 15021
    57      protocol: TCP
    58      targetPort: 15021
    59    - appProtocol: http
    60      name: default
    61      nodePort: 30686
    62      port: 80
    63      protocol: TCP
    64      targetPort: 80
    65    selector:
    66      gateway.networking.k8s.io/gateway-name: gateway
    67    type: LoadBalancer