mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-08-28 17:57:16 +00:00
Inject delay and failures for the orange backend
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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,4 +1,4 @@
|
||||
package version
|
||||
|
||||
var VERSION = "0.6.0-rc.1"
|
||||
var VERSION = "0.6.0-rc.3"
|
||||
var GITCOMMIT = "unknown"
|
||||
|
||||
Reference in New Issue
Block a user