I use EnvoyFilter
to controller outlier, but has no effect. Any suggestions?
This is my deploy config:
apiVersion: v1
kind: ServiceAccount
metadata:
name: restdemo
---
apiVersion: v1
kind: Service
metadata:
name: restdemo
labels:
app: restdemo
service: restdemo
spec:
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: restdemo
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: restdemo
spec:
replicas: 1
selector:
matchLabels:
app: restdemo
version: v2
template:
metadata:
labels:
app: restdemo
version: v2
annotations:
proxy.istio.io/config: |-
proxyStatsMatcher:
inclusionRegexps:
- ".*http_local_rate_limit.*"
- "cluster.*.outlier_detection.*"
spec:
serviceAccountName: restdemo
containers:
- image: myimg/demo:v2
imagePullPolicy: IfNotPresent
name: restdemo
ports:
- containerPort: 8080
This is my virtual service:
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: restdemo
spec:
hosts:
- "*"
gateways:
- istio-system/istio-gateway
http:
- route:
- destination:
host: restdemo
port:
number: 8080
This is my outlier config:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: rest-outlier-cluster
namespace: default
spec:
configPatches:
- applyTo: CLUSTER
match:
context: SIDECAR_OUTBOUND
cluster:
name: "outbound|8080||restdemo.default.svc.cluster.local"
patch:
operation: MERGE
value:
"outlier_detection": {
"consecutive_5xx": 5,
"interval": "15s",
"base_ejection_time": "60s",
"max_ejection_percent": 100,
"enforcing_consecutive_5xx": 100,
"max_ejection_time": "300s",
}
I made consecutive requests which will return error code 500. But outlier doesn’t take effects, I always get result from upstream pods.