From 6d8e706977ea2bf8548f9302fe9ceca433380606 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Mon, 10 Sep 2018 13:32:13 +0000 Subject: [PATCH] istio --- istio/helloworld-v2-canary.yaml | 37 ++++++++++++++ istio/helloworld-v3.yaml | 91 +++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 istio/helloworld-v2-canary.yaml create mode 100644 istio/helloworld-v3.yaml diff --git a/istio/helloworld-v2-canary.yaml b/istio/helloworld-v2-canary.yaml new file mode 100644 index 0000000..a4f028a --- /dev/null +++ b/istio/helloworld-v2-canary.yaml @@ -0,0 +1,37 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: hello +spec: + host: hello.default.svc.cluster.local + subsets: + - name: v1 + labels: + version: v1 + - name: v2 + labels: + version: v2 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: helloworld +spec: + hosts: + - "hello.example.com" + gateways: + - helloworld-gateway + http: + - route: + - destination: + host: hello.default.svc.cluster.local + subset: v1 + port: + number: 8080 + weight: 90 + - destination: + host: hello.default.svc.cluster.local + subset: v2 + port: + number: 8080 + weight: 10 diff --git a/istio/helloworld-v3.yaml b/istio/helloworld-v3.yaml new file mode 100644 index 0000000..6c2002c --- /dev/null +++ b/istio/helloworld-v3.yaml @@ -0,0 +1,91 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: hello-v3 +spec: + replicas: 2 + template: + metadata: + labels: + app: hello + version: v3 + spec: + containers: + - name: hello + image: wardviaene/http-echo + env: + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: TEXT + value: hello, this is $(MY_POD_NAME) + ports: + - name: http + containerPort: 8080 +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: hello-v3-latency +spec: + replicas: 1 + template: + metadata: + labels: + app: hello + version: v3 + spec: + containers: + - name: hello + image: wardviaene/http-echo + env: + - name: MY_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: TEXT + value: hello, this is $(MY_POD_NAME) + - name: LATENCY + value: "5" + ports: + - name: http + containerPort: 8080 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: hello +spec: + host: hello.default.svc.cluster.local + subsets: + - name: v1 + labels: + version: v1 + - name: v2 + labels: + version: v2 + - name: v3 + labels: + version: v3 +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: helloworld-v3 +spec: + hosts: + - "hello-v3.example.com" + gateways: + - helloworld-gateway + http: + - route: # default route for hello.example.com + - destination: + host: hello.default.svc.cluster.local + subset: v3 # match v3 only + port: + number: 8080 + timeout: 10s + retries: + attempts: 2 + perTryTimeout: 2s