github.com/looshlee/cilium@v1.6.12/examples/kubernetes-istio/bookinfo-ratings-v1.yaml (about)

     1  # Copyright 2017 Istio Authors
     2  #
     3  #   Licensed under the Apache License, Version 2.0 (the "License");
     4  #   you may not use this file except in compliance with the License.
     5  #   You may obtain a copy of the License at
     6  #
     7  #       http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  #   Unless required by applicable law or agreed to in writing, software
    10  #   distributed under the License is distributed on an "AS IS" BASIS,
    11  #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  #   See the License for the specific language governing permissions and
    13  #   limitations under the License.
    14  
    15  ##################################################################################################
    16  # Ratings service
    17  ##################################################################################################
    18  apiVersion: v1
    19  kind: Service
    20  metadata:
    21    name: ratings
    22    labels:
    23      app: ratings
    24  spec:
    25    ports:
    26    - port: 9080
    27      name: http
    28    selector:
    29      app: ratings
    30  ---
    31  apiVersion: cilium.io/v2
    32  kind: CiliumNetworkPolicy
    33  metadata:
    34    name: ratings-v1
    35    namespace: default
    36  specs:
    37    - endpointSelector:
    38        matchLabels:
    39          "k8s:app": ratings
    40          "k8s:version": v1
    41      ingress:
    42      - fromEndpoints:
    43        - matchLabels:
    44            "k8s:app": productpage
    45            "k8s:version": v1
    46        toPorts:
    47        - ports:
    48          - port: "9080"
    49            protocol: TCP
    50          rules:
    51            http:
    52            - method: GET
    53              path: "/ratings/[0-9]*"
    54      - fromEndpoints:
    55          - matchLabels:
    56              "k8s:app": reviews
    57              "k8s:version": v2
    58        toPorts:
    59        - ports:
    60          - port: "9080"
    61            protocol: TCP
    62          rules:
    63            http:
    64            - method: GET
    65              path: "/ratings/[0-9]*"
    66  ---
    67  apiVersion: apps/v1
    68  kind: Deployment
    69  metadata:
    70    name: ratings-v1
    71  spec:
    72    selector:
    73      matchLabels:
    74        app: ratings
    75        version: v1
    76    replicas: 1
    77    template:
    78      metadata:
    79        annotations:
    80          sidecar.istio.io/inject: "true"
    81        labels:
    82          app: ratings
    83          version: v1
    84      spec:
    85        containers:
    86        - name: ratings
    87          image: docker.io/istio/examples-bookinfo-ratings-v1:0.2.8
    88          imagePullPolicy: IfNotPresent
    89          ports:
    90          - containerPort: 9080