From fce0fb89b2ac9348ea021b7ae6104711ebe3e85a Mon Sep 17 00:00:00 2001 From: marcel-dempers Date: Sat, 24 Oct 2020 20:36:10 +1100 Subject: [PATCH] test traffic split and auto retry --- .../applications/videos-web/index-v2.html | 99 +++++++++++++++++++ .../servicemesh/istio/retries/videos-api.yaml | 14 +++ .../istio/traffic-splits/videos-web-v2.yaml | 43 ++++++++ .../istio/traffic-splits/videos-web.yaml | 15 +++ 4 files changed, 171 insertions(+) create mode 100644 kubernetes/servicemesh/applications/videos-web/index-v2.html create mode 100644 kubernetes/servicemesh/istio/retries/videos-api.yaml create mode 100644 kubernetes/servicemesh/istio/traffic-splits/videos-web-v2.yaml create mode 100644 kubernetes/servicemesh/istio/traffic-splits/videos-web.yaml diff --git a/kubernetes/servicemesh/applications/videos-web/index-v2.html b/kubernetes/servicemesh/applications/videos-web/index-v2.html new file mode 100644 index 0000000..604dd0a --- /dev/null +++ b/kubernetes/servicemesh/applications/videos-web/index-v2.html @@ -0,0 +1,99 @@ + + + + + + + Video Catalog + + + + + +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ Card image cap +
+
{{ v.title }}
+

{{ v.description }}

+ Watch +
+
+
+ + +
+
+
+ + +
+
+ +
+
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/kubernetes/servicemesh/istio/retries/videos-api.yaml b/kubernetes/servicemesh/istio/retries/videos-api.yaml new file mode 100644 index 0000000..574e4f6 --- /dev/null +++ b/kubernetes/servicemesh/istio/retries/videos-api.yaml @@ -0,0 +1,14 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: videos-api +spec: + hosts: + - videos-api + http: + - route: + - destination: + host: videos-api + retries: + attempts: 10 + perTryTimeout: 2s \ No newline at end of file diff --git a/kubernetes/servicemesh/istio/traffic-splits/videos-web-v2.yaml b/kubernetes/servicemesh/istio/traffic-splits/videos-web-v2.yaml new file mode 100644 index 0000000..24e4dd6 --- /dev/null +++ b/kubernetes/servicemesh/istio/traffic-splits/videos-web-v2.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: videos-web-v2 + labels: + app: videos-web-v2 +spec: + selector: + matchLabels: + app: videos-web-v2 + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + template: + metadata: + labels: + app: videos-web-v2 + spec: + containers: + - name: videos-web-v2 + image: aimvector/service-mesh:videos-web-2.0.0 + imagePullPolicy : Always + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: videos-web-v2 + labels: + app: videos-web-v2 +spec: + type: ClusterIP + selector: + app: videos-web-v2 + ports: + - protocol: TCP + name: http + port: 80 + targetPort: 80 \ No newline at end of file diff --git a/kubernetes/servicemesh/istio/traffic-splits/videos-web.yaml b/kubernetes/servicemesh/istio/traffic-splits/videos-web.yaml new file mode 100644 index 0000000..b7dabc2 --- /dev/null +++ b/kubernetes/servicemesh/istio/traffic-splits/videos-web.yaml @@ -0,0 +1,15 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: videos-web +spec: + hosts: + - servicemesh.demo + http: + - route: + - destination: + host: videos-web-v2 + weight: 50 + - destination: + host: videos-web + weight: 50 \ No newline at end of file