Why EnvoyFilter does not generate Envoy configurations under the specified namespace. Envoy configurations can be generated under Istio-System

Viewed 27

Why EnVoyFilter does not generate Envoy configurations under the specified namespace. Envoy configurations can be generated under Istio-System.

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: 503-redirect-lua-filter
  namespace: idp
spec:
 # workloadSelector:
 #   labels:
 #     ray-node-name: ray-idp-raycluster-a-executor-head
  configPatches:
  - applyTo: HTTP_FILTER
    match:
      context: GATEWAY
      listener:
        filterChain:
          filter:
            name: envoy.filters.network.http_connection_manager
            subFilter:
              name: envoy.filters.http.router
    patch:
      operation: INSERT_BEFORE
      value:
       name: envoy.filters.http.lua
       typed_config:
         "@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua"
         inlineCode: |
           function envoy_on_response(response_handle)
               if response_handle:headers():get(":status") == "503" then
                   response_handle:logInfo("Got status 503, redirect to login...")
                   response_handle:headers():replace(":status", "302")
                   response_handle:headers():add("location", "https://xxxx.xxxx.co/studio")
               end
           end
kubectl -n istio-system exec istio-ingressgateway-787c7bd99b-p97q2 -c istio-proxy -- curl 'localhost:15000/config_dump' > config_dump.jsonv
0 Answers
Related