Fault injection — delay
Inject artificial delay to test resilience (in VirtualService)
# In VirtualService spec.http[].fault.delay
- tool
- istio19 commands
More istio commands
-
# In VirtualService spec.http[].mirrorMirror traffic to a shadow service for testing
-
istioctl uninstall --purge -yCompletely remove Istio from the cluster
-
kubectl apply -f - <<EOF apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: myapp spec: hosts: - myapp http: - route: - destination: host: myapp subset: v1 weight: 80 - destination: host: myapp subset: v2 weight: 20 EOFRoute 80% traffic to v1, 20% to v2 (canary split)
-
kubectl apply -f - <<EOF apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: myapp spec: host: myapp trafficPolicy: outlierDetection: consecutive5xxErrors: 5 interval: 10s baseEjectionTime: 30s subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 EOFDefine subsets and circuit breaker (outlier detection)
-
kubectl apply -f - <<EOF apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: myapp spec: hosts: - myapp http: - fault: delay: percentage: value: 100 fixedDelay: 5s route: - destination: host: myapp EOFInject 5s delay for 100% of requests to test resilience