github.phpd.cn/cilium/cilium@v1.6.12/examples/kubernetes-istio/bookinfo-reviews-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  # Reviews service
    17  ##################################################################################################
    18  apiVersion: v1
    19  kind: Service
    20  metadata:
    21    name: reviews
    22    labels:
    23      app: reviews
    24  spec:
    25    ports:
    26    - port: 9080
    27      name: http
    28    selector:
    29      app: reviews
    30  ---
    31  apiVersion: cilium.io/v2
    32  kind: CiliumNetworkPolicy
    33  metadata:
    34    name: reviews-v1
    35    namespace: default
    36  specs:
    37    - endpointSelector:
    38        matchLabels:
    39          "k8s:app": reviews
    40          "k8s:version": v1
    41      ingress:
    42      - fromEndpoints:
    43        - matchLabels:
    44            "k8s:app": productpage
    45        toPorts:
    46        - ports:
    47          - port: "9080"
    48            protocol: TCP
    49          rules:
    50            http:
    51            - method: GET
    52              path: "/reviews/[0-9]*"
    53  ---
    54  apiVersion: apps/v1
    55  kind: Deployment
    56  metadata:
    57    name: reviews-v1
    58  spec:
    59    selector:
    60      matchLabels:
    61        app: reviews
    62        version: v1
    63    replicas: 1
    64    template:
    65      metadata:
    66        annotations:
    67          sidecar.istio.io/inject: "true"
    68        labels:
    69          app: reviews
    70          version: v1
    71      spec:
    72        containers:
    73        - name: reviews
    74          image: docker.io/istio/examples-bookinfo-reviews-v1:1.10.1
    75          imagePullPolicy: IfNotPresent
    76          ports:
    77          - containerPort: 9080