Skip to content

Commit

Permalink
istio
Browse files Browse the repository at this point in the history
  • Loading branch information
wardviaene committed Sep 10, 2018
1 parent 51c1021 commit 6d8e706
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 0 deletions.
37 changes: 37 additions & 0 deletions istio/helloworld-v2-canary.yaml
Original file line number Diff line number Diff line change
@@ -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
91 changes: 91 additions & 0 deletions istio/helloworld-v3.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6d8e706

Please sign in to comment.