我有 ext_authz 过滤器,如下所示:
kind: EnvoyFilter
metadata:
name: authn-filter
namespace: istio-system
spec:
workloadSelector:
labels:
istio: ingressgateway
configPatches:
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: "envoy.http_connection_manager"
subFilter:
name: "envoy.router"
patch:
operation: INSERT_BEFORE
value:
name: envoy.ext_authz
config:
http_service:
server_uri:
uri: http://authservice.istio-system.svc.cluster.local
cluster: outbound|8080||authservice.istio-system.svc.cluster.local
failure_mode_allow: false
timeout: 10s
authorization_request:
allowed_headers:
patterns:
- exact: "cookie"
- exact: "X-Auth-Token"
authorization_response:
allowed_upstream_headers:
patterns:
- exact: "kubeflow-userid"
status_on_error:
code: GatewayTimeout
Run Code Online (Sandbox Code Playgroud)
问题是它适用于同一入口下的所有虚拟主机。我只想将其应用于特定的虚拟主机。目前我使用以下内容排除一些主机:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: bypass-auth-filter
namespace: istio-system
spec:
workloadSelector:
labels:
istio: ingressgateway …Run Code Online (Sandbox Code Playgroud)