forked from wardviaene/kubernetes-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51c1021
commit 6d8e706
Showing
2 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |