Inject delay and failures for the orange backend

This commit is contained in:
Stefan Prodan
2018-08-15 13:37:40 +03:00
parent 7622dfb74f
commit 75d93e0c54
8 changed files with 42 additions and 9 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ spec:
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:0.6.0-rc.1
image: quay.io/stefanprodan/podinfo:0.6.0-rc.3
command:
- ./podinfo
- -port=9898
+1 -1
View File
@@ -22,7 +22,7 @@ spec:
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:0.6.0-rc.1
image: quay.io/stefanprodan/podinfo:0.6.0-rc.3
command:
- ./podinfo
- -port=9898
+6 -4
View File
@@ -10,11 +10,13 @@ spec:
# new version
# forward 100% of the traffic to orange
- match:
- headers:
x-api-version:
regex: "^(v{0,1})0\\.6\\.([0-9]{1,3}).*"
# - headers:
# x-api-version:
# regex: "^(v{0,1})0\\.6\\.([0-9]{1,3}).*"
- sourceLabels:
color: blue
route:
- destination:
- destination:
host: podinfo-backend
subset: orange
timeout: 20s
+1 -1
View File
@@ -22,7 +22,7 @@ spec:
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:0.6.0-rc.1
image: quay.io/stefanprodan/podinfo:0.6.0-rc.3
command:
- ./podinfo
- -port=9898
+1 -1
View File
@@ -22,7 +22,7 @@ spec:
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:0.6.0-rc.1
image: quay.io/stefanprodan/podinfo:0.6.0-rc.3
command:
- ./podinfo
- -port=9898
+27
View File
@@ -0,0 +1,27 @@
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: podinfo-store
spec:
hosts:
- podinfo-store
http:
- match:
- sourceLabels:
color: orange
route:
- destination:
host: podinfo-store
timeout: 15s
fault:
delay:
percent: 50
fixedDelay: 500ms
abort:
percent: 50
httpStatus: 500
- route:
- destination:
host: podinfo-store
timeout: 15s
+4
View File
@@ -157,6 +157,10 @@ func (s *Server) backend(w http.ResponseWriter, r *http.Request) {
return
}
defer resp.Body.Close()
if resp.StatusCode >= 500 {
w.WriteHeader(resp.StatusCode)
return
}
rbody, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Error().Msgf("Reading the backend request body failed: %v", err)
+1 -1
View File
@@ -1,4 +1,4 @@
package version
var VERSION = "0.6.0-rc.1"
var VERSION = "0.6.0-rc.3"
var GITCOMMIT = "unknown"