0

I am using istio in knative. Since the client ip did not come, I activated the reverse-prox. I added envoyfilter. but I get "upstream connect error or disconnect/reset before headers. reset reason: connection termination" error in services on knative. if it's not knative service I can access it.

virtualservice

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: test-entry-route
  namespace: default
spec:
  gateways:
    - knative-serving/knative-ingress-gateway
  hosts:
    - "test.net"
  http:
    - match:
        - uri:
            prefix: /test/ #working
      rewrite:
        uri: /
      route:
        - destination:
            host: user-api.test.svc.cluster.local
            port:
              number: 80
    - match:
        - uri:
            prefix: /user/ #not working
      route:
        - destination:
            host: istio-ingressgateway.istio-system.svc.cluster.local
            port:
              number: 80
          weight: 100
      rewrite:
        authority: user-api.poker-test.k8s.test.net
        uri: /

EnvoyFilter

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: proxy-protocol
  namespace: istio-system
spec:
  configPatches:
    - applyTo: LISTENER
      patch:
        operation: MERGE
        value:
          listener_filters:
            - name: envoy.listener.proxy_protocol
            - name: envoy.listener.tls_inspector
  workloadSelector:
    labels:
      istio: ingressgateway

service load balancer

annotations:
    service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: 'true'
externalTrafficPolicy: Local
Mikołaj Głodziak
  • 4,775
  • 7
  • 28
Adem Çınar
  • 416
  • 3
  • 3
  • Which version of Istio did you use? How did you set up your cluster? It is bare metal or did you use some cloud providor? – Mikołaj Głodziak Sep 08 '21 at 07:03
  • Hi @AdemÇına, as said before is useful to know more details about versions and cloud providers do you use. For example AWS alb sand by default `X-Forwarded headers ` then if you enabled it on istio side with `X-Forwarded-For` you can retrieve information that you need – fbalicchia Sep 19 '21 at 15:26

0 Answers0