代码之家  ›  专栏  ›  技术社区  ›  user674669

将istio配置为不拦截到serviceb:port的通信

  •  0
  • user674669  · 技术社区  · 5 年前

    我是新来的。ISTIO通过ISTIO代理/特使拦截两个服务之间的所有通信。是否可以配置istio以忽略特定类型的通信

    • 当servicea在某个端口上直接对serviceb进行https调用时
    • udp通信

    谢谢

    0 回复  |  直到 5 年前
        1
  •  2
  •   Stefan P.    5 年前

    根据ISTIO sidecar injection configuration 您可以使用 traffic.sidecar.istio.io/excludeInboundPorts 注释。

    例子:

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: podinfo
      namespace: test
      labels:
        app: podinfo
    spec:
      selector:
        matchLabels:
          app: podinfo
      template:
        metadata:
          annotations:
            traffic.sidecar.istio.io/excludeInboundPorts: "9999,9229"
          labels:
            app: podinfo
        spec:
          containers:
          - name: podinfod
            image: quay.io/stefanprodan/podinfo:1.4.0
            imagePullPolicy: IfNotPresent
            ports:
            - containerPort: 9898
              name: http
              protocol: TCP
            - containerPort: 9999 # <- excluded port
              protocol: UDP
            - containerPort: 9229 # <- excluded port
              protocol: TCP
            command:
            - ./podinfo
            - --port=9898
            - --level=info