istio.io/istio@v0.0.0-20240520182934-d79c90f27776/tests/testdata/networking/sidecar-ns-scope/configs.yaml (about)

     1  apiVersion: networking.istio.io/v1alpha3
     2  kind: Sidecar
     3  metadata:
     4    name: default-sidecar-scope
     5    namespace: istio-config
     6  spec:
     7    egress:
     8    - hosts:
     9      - "./*"
    10  ---
    11  # Authentication policy to enable mutual TLS for all services (that have sidecar) in the mesh.
    12  apiVersion: security.istio.io/v1beta1
    13  kind: PeerAuthentication
    14  metadata:
    15    name: default
    16    namespace: istio-config
    17  spec:
    18    mtls:
    19      mode: STRICT
    20  ---
    21  # Corresponding destination rule to configure client side to use mutual TLS when talking to
    22  # any service (host) in the mesh.
    23  apiVersion: networking.istio.io/v1alpha3
    24  kind: DestinationRule
    25  metadata:
    26    name: default
    27    namespace: istio-config
    28  spec:
    29    host: "*.local"
    30    trafficPolicy:
    31      tls:
    32        mode: ISTIO_MUTUAL
    33  ---
    34  # Services and configs in ns1 namespace
    35  apiVersion: networking.istio.io/v1alpha3
    36  kind: ServiceEntry
    37  metadata:
    38    name: http1
    39    namespace: ns1
    40  spec:
    41    hosts:
    42    - http1.ns1.svc.cluster.local
    43    addresses:
    44    - 2.1.1.1
    45    ports:
    46    - number: 8080
    47      name: http
    48      protocol: HTTP2
    49    location: MESH_INTERNAL
    50    resolution: STATIC
    51    endpoints:
    52    - address: 100.1.1.1
    53      labels:
    54        version: v1
    55      ports:
    56        http: 8080
    57    - address: 100.1.2.1
    58      labels:
    59        version: v2
    60      ports:
    61        http: 8080
    62  ---
    63  apiVersion: networking.istio.io/v1alpha3
    64  kind: ServiceEntry
    65  metadata:
    66    name: http2
    67    namespace: ns1
    68  spec:
    69    hosts:
    70    - http2.ns1.svc.cluster.local
    71    addresses:
    72    - 2.1.1.2
    73    ports:
    74    - number: 8080
    75      name: http
    76      protocol: HTTP2
    77    location: MESH_INTERNAL
    78    resolution: STATIC
    79    endpoints:
    80    - address: 100.1.1.2
    81      ports:
    82        http: 8080
    83  ---
    84  apiVersion: networking.istio.io/v1alpha3
    85  kind: ServiceEntry
    86  metadata:
    87    name: tcp1
    88    namespace: ns1
    89  spec:
    90    hosts:
    91    - tcp1.ns1.svc.cluster.local
    92    addresses:
    93    - 2.1.1.3
    94    ports:
    95    - number: 3306
    96      name: tcp
    97      protocol: TCP
    98    location: MESH_INTERNAL
    99    resolution: STATIC
   100    endpoints:
   101    - address: 100.1.1.3
   102      ports:
   103        tcp: 3306
   104  ---
   105  apiVersion: networking.istio.io/v1alpha3
   106  kind: DestinationRule
   107  metadata:
   108    name: http1
   109    namespace: ns1
   110  spec:
   111    host: http1.ns1.svc.cluster.local
   112    subsets:
   113    - name: v1
   114      labels:
   115        version: v1
   116    - name: v2
   117      labels:
   118        version: v2
   119  ---
   120  apiVersion: networking.istio.io/v1alpha3
   121  kind: VirtualService
   122  metadata:
   123    name: http1
   124    namespace: ns1
   125  spec:
   126    hosts:
   127    - http1.ns1.svc.cluster.local
   128    http:
   129    - route:
   130      - destination:
   131          host: http1.ns1.svc.cluster.local
   132          subset: v1
   133        weight: 70
   134      - destination:
   135          host: http1.ns1.svc.cluster.local
   136          subset: v2
   137        weight: 30
   138  ---
   139  apiVersion: networking.istio.io/v1alpha3
   140  kind: ServiceEntry
   141  metadata:
   142    name: http1
   143    namespace: ns2
   144  spec:
   145    hosts:
   146    - http1.ns2.svc.cluster.local
   147    addresses:
   148    - 3.1.1.1
   149    ports:
   150    - number: 8080
   151      name: http
   152      protocol: HTTP2
   153    location: MESH_INTERNAL
   154    resolution: STATIC
   155    endpoints:
   156    - address: 200.1.1.1
   157      ports:
   158        http: 8080
   159  ---
   160  apiVersion: networking.istio.io/v1alpha3
   161  kind: ServiceEntry
   162  metadata:
   163    name: http2
   164    namespace: ns2
   165  spec:
   166    hosts:
   167    - http2.ns2.svc.cluster.local
   168    addresses:
   169    - 3.1.1.2
   170    ports:
   171    - number: 8080
   172      name: http
   173      protocol: HTTP2
   174    location: MESH_INTERNAL
   175    resolution: STATIC
   176    endpoints:
   177    - address: 200.1.1.2
   178      ports:
   179        http: 8080
   180  ---
   181  apiVersion: networking.istio.io/v1alpha3
   182  kind: ServiceEntry
   183  metadata:
   184    name: tcp1
   185    namespace: ns2
   186  spec:
   187    hosts:
   188    - tcp1.ns2.svc.cluster.local
   189    addresses:
   190    - 3.1.1.3
   191    ports:
   192    - number: 3306
   193      name: tcp
   194      protocol: TCP
   195    location: MESH_INTERNAL
   196    resolution: STATIC
   197    endpoints:
   198    - address: 200.1.1.3
   199      ports:
   200        tcp: 3306
   201  ---