mirror of
https://github.com/wardviaene/kubernetes-course.git
synced 2026-07-10 14:19:31 +00:00
istio
This commit is contained in:
37
istio/helloworld-v2-canary.yaml
Normal file
37
istio/helloworld-v2-canary.yaml
Normal file
@@ -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
istio/helloworld-v3.yaml
Normal file
91
istio/helloworld-v3.yaml
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user