forked from christian-posta/kube-demos
-
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.
initial commit of service mesh demo with istio based on their demos a…
…t istio/istio
- Loading branch information
1 parent
0ce3cfc
commit 6765c9a
Showing
24 changed files
with
1,075 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,218 @@ | ||
# Copyright 2017 Istio Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
################################################################################################## | ||
# Details service | ||
################################################################################################## | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: details | ||
labels: | ||
app: details | ||
spec: | ||
ports: | ||
- port: 9080 | ||
name: http | ||
selector: | ||
app: details | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: details-v1 | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: details | ||
version: v1 | ||
spec: | ||
containers: | ||
- name: details | ||
image: istio/examples-bookinfo-details-v1 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 9080 | ||
--- | ||
################################################################################################## | ||
# Ratings service | ||
################################################################################################## | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ratings | ||
labels: | ||
app: ratings | ||
spec: | ||
ports: | ||
- port: 9080 | ||
name: http | ||
selector: | ||
app: ratings | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: ratings-v1 | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: ratings | ||
version: v1 | ||
spec: | ||
containers: | ||
- name: ratings | ||
image: istio/examples-bookinfo-ratings-v1 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 9080 | ||
--- | ||
################################################################################################## | ||
# Reviews service | ||
################################################################################################## | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: reviews | ||
labels: | ||
app: reviews | ||
spec: | ||
ports: | ||
- port: 9080 | ||
name: http | ||
selector: | ||
app: reviews | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: reviews-v1 | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: reviews | ||
version: v1 | ||
spec: | ||
containers: | ||
- name: reviews | ||
image: istio/examples-bookinfo-reviews-v1 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 9080 | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: reviews-v2 | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: reviews | ||
version: v2 | ||
spec: | ||
containers: | ||
- name: reviews | ||
image: istio/examples-bookinfo-reviews-v2 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 9080 | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: reviews-v3 | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: reviews | ||
version: v3 | ||
spec: | ||
containers: | ||
- name: reviews | ||
image: istio/examples-bookinfo-reviews-v3 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 9080 | ||
--- | ||
################################################################################################## | ||
# Productpage service | ||
################################################################################################## | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: productpage | ||
labels: | ||
app: productpage | ||
spec: | ||
ports: | ||
- port: 9080 | ||
name: http | ||
selector: | ||
app: productpage | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: productpage-v1 | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: productpage | ||
version: v1 | ||
spec: | ||
containers: | ||
- name: productpage | ||
image: istio/examples-bookinfo-productpage-v1 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 9080 | ||
--- | ||
########################################################################### | ||
# Ingress resource (gateway) | ||
########################################################################## | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: gateway | ||
annotations: | ||
kubernetes.io/ingress.class: "istio" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /productpage | ||
backend: | ||
serviceName: productpage | ||
servicePort: 9080 | ||
- path: /login | ||
backend: | ||
serviceName: productpage | ||
servicePort: 9080 | ||
- path: /logout | ||
backend: | ||
serviceName: productpage | ||
servicePort: 9080 | ||
--- |
16 changes: 16 additions & 0 deletions
16
service-mesh/istio/bookinfo/app/destination-ratings-test-delay.yaml
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,16 @@ | ||
type: route-rule | ||
name: ratings-test-delay | ||
spec: | ||
destination: ratings.default.svc.cluster.local | ||
precedence: 2 | ||
match: | ||
httpHeaders: | ||
Cookie: | ||
regex: "^(.*?;)?(user=jason)(;.*)?$" | ||
route: | ||
- tags: | ||
version: v1 | ||
httpFault: | ||
delay: | ||
percent: 100 | ||
fixedDelaySeconds: 5.0 |
7 changes: 7 additions & 0 deletions
7
service-mesh/istio/bookinfo/app/mixer-rule-ratings-ratelimit.yaml
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,7 @@ | ||
type: mixer-rule | ||
name: ratings-ratelimit | ||
spec: | ||
selector: target.service == "ratings.default.svc.cluster.local" | ||
aspects: | ||
- kind: quotas | ||
params: |
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,35 @@ | ||
type: route-rule | ||
name: productpage-default | ||
spec: | ||
destination: productpage.default.svc.cluster.local | ||
precedence: 1 | ||
route: | ||
- tags: | ||
version: v1 | ||
--- | ||
type: route-rule | ||
name: reviews-default | ||
spec: | ||
destination: reviews.default.svc.cluster.local | ||
precedence: 1 | ||
route: | ||
- tags: | ||
version: v1 | ||
--- | ||
type: route-rule | ||
name: ratings-default | ||
spec: | ||
destination: ratings.default.svc.cluster.local | ||
precedence: 1 | ||
route: | ||
- tags: | ||
version: v1 | ||
--- | ||
type: route-rule | ||
name: details-default | ||
spec: | ||
destination: details.default.svc.cluster.local | ||
precedence: 1 | ||
route: | ||
- tags: | ||
version: v1 |
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,16 @@ | ||
type: route-rule | ||
name: ratings-test-delay | ||
spec: | ||
destination: ratings.default.svc.cluster.local | ||
precedence: 2 | ||
match: | ||
httpHeaders: | ||
Cookie: | ||
regex: "^(.*?;)?(user=test-user)(;.*)?$" | ||
route: | ||
- tags: | ||
version: v1 | ||
httpFault: | ||
delay: | ||
percent: 100 | ||
fixedDelaySeconds: 7.0 |
12 changes: 12 additions & 0 deletions
12
service-mesh/istio/bookinfo/app/route-rule-reviews-50-v3.yaml
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,12 @@ | ||
type: route-rule | ||
name: reviews-default | ||
spec: | ||
destination: reviews.default.svc.cluster.local | ||
precedence: 1 | ||
route: | ||
- tags: | ||
version: v1 | ||
weight: 50 | ||
- tags: | ||
version: v3 | ||
weight: 50 |
12 changes: 12 additions & 0 deletions
12
service-mesh/istio/bookinfo/app/route-rule-reviews-test-v2.yaml
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,12 @@ | ||
type: route-rule | ||
name: reviews-test-v2 | ||
spec: | ||
destination: reviews.default.svc.cluster.local | ||
precedence: 2 | ||
match: | ||
httpHeaders: | ||
Cookie: | ||
regex: "^(.*?;)?(user=jason)(;.*)?$" | ||
route: | ||
- tags: | ||
version: v2 |
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,9 @@ | ||
type: route-rule | ||
name: reviews-default | ||
spec: | ||
destination: reviews.default.svc.cluster.local | ||
precedence: 1 | ||
route: | ||
- tags: | ||
version: v3 | ||
weight: 100 |
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,13 @@ | ||
#!/bin/bash | ||
|
||
. $(dirname ${BASH_SOURCE})/../../../util.sh | ||
|
||
istioctl delete route-rule productpage-default | ||
istioctl delete route-rule reviews-default | ||
istioctl delete route-rule ratings-default | ||
istioctl delete route-rule details-default | ||
istioctl delete route-rule reviews-test-v2 | ||
istioctl delete route-rule ratings-test-delay | ||
#istioctl delete mixer-rule ratings-ratelimit | ||
|
||
kubectl delete -f $(relative app/bookinfo.yaml) |
Oops, something went wrong.