我无法通过出口配置在我的elb上运行断路配置。
ELB elb的成功率为25%(75%500错误,25%,状态200), elb有4个实例,只有1个返回成功响应,其他实例配置为返回500错误以进行测试。
设置
k8s:v1.7.4
istio:0.5.0
出口规则
apiVersion: config.istio.io/v1alpha2
kind: EgressRule
metadata:
name: elb-egress-rule
spec:
destination:
service: xxxx.us-east-1.elb.amazonaws.com
ports:
- port: 80
protocol: http
目标政策
kind: DestinationPolicy
metadata:
name: elb-circuit-breaker
spec:
destination:
service: xxxx.us-east-1.elb.amazonaws.com
loadBalancing:
name: RANDOM
circuitBreaker:
simpleCb:
maxConnections: 100
httpMaxPendingRequests: 100
sleepWindow: 3m
httpDetectionInterval: 1s
httpMaxEjectionPercent: 100
httpConsecutiveErrors: 3
httpMaxRequestsPerConnection: 10
路线规则:未设置
测试
apiVersion: v1
kind: Service
metadata:
name: sleep
labels:
app: sleep
spec:
ports:
- port: 80
name: http
selector:
app: sleep
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: sleep
spec:
replicas: 1
template:
metadata:
labels:
app: sleep
spec:
containers:
- name: sleep
image: tutum/curl
command: ["/bin/sleep","infinity"]
imagePullPolicy: IfNotPresent
export SOURCE_POD=$(kubectl get pod -l app=sleep -o jsonpath={.items..metadata.name})
kubectl exec -it $SOURCE_POD -c sleep bash
从pod中并行发送请求
#!/bin/sh
set -m # Enable Job Control
for i in `seq 100`; do # start 100 jobs in parallel
curl xxxx.us-east-1.elb.amazonaws.com &
done
答案 0 :(得分:1)
目前,Istio认为Egress Rule
指定一个主机。由于负载均衡器的Envoy(Istio的边车代理实现)的恐慌阈值,这个单一主机不会被弹出。 Envoy的默认恐慌阈值是50%。这意味着一个主机至少需要两台主机才能弹出,因此Egress Rule
的单个主机不会被弹出。
这实际上意味着httpConsecutiveErrors
不会影响外部服务。使用External Services
替换Egress Rules
的{{1}}部分解决了这种功能缺失的问题。
请参阅由多个端点支持的Istio External Services
的文档 - https://github.com/istio/api/blob/master/routing/v1alpha2/external_service.proto#L113