istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/config/analysis/analyzers/testdata/deployment-multi-service-different-ns.yaml (about)

     1  apiVersion: v1
     2  kind: Namespace
     3  metadata:
     4    name: bookinfo
     5    labels:
     6      istio-injection: "enabled"
     7  spec: {}
     8  ---
     9  apiVersion: v1
    10  kind: Namespace
    11  metadata:
    12    name: bookinfo2
    13    labels:
    14      istio-injection: "enabled"
    15  spec: {}
    16  ---
    17  # Deployment should not generate a warning: although two services using that deployment
    18  # using the same port, they are in different namespaces.
    19  apiVersion: apps/v1
    20  kind: Deployment
    21  metadata:
    22    name: conflicting-ports
    23    namespace: bookinfo
    24    labels:
    25      app: conflicting-ports
    26      version: v1
    27  spec:
    28    replicas: 1
    29    selector:
    30      matchLabels:
    31        app: conflicting-ports
    32        version: v1
    33    template:
    34      metadata:
    35        labels:
    36          app: conflicting-ports
    37          version: v1
    38      spec:
    39        serviceAccountName: bookinfo-details
    40        containers:
    41          - name: details
    42            image: docker.io/istio/examples-bookinfo-details-v1:1.15.0
    43            imagePullPolicy: IfNotPresent
    44            ports:
    45              - containerPort: 9080
    46  ---
    47  apiVersion: v1
    48  kind: Service
    49  metadata:
    50    name: conflicting-ports-1
    51    namespace: bookinfo
    52    labels:
    53      app: conflicting-ports
    54  spec:
    55    ports:
    56      - port: 9080
    57        name: tcp
    58        targetPort: 9080
    59        protocol: TCP
    60    selector:
    61      app: conflicting-ports
    62  ---
    63  apiVersion: v1
    64  kind: Service
    65  metadata:
    66    name: conflicting-ports-1
    67    namespace: bookinfo2
    68    labels:
    69      app: conflicting-ports
    70  spec:
    71    ports:
    72      - port: 9090
    73        name: http
    74        targetPort: 9080
    75        protocol: HTTP
    76    selector:
    77      app: conflicting-ports