Created
February 24, 2025 13:36
-
-
Save nirgeier/e989824e6fe4df83719482c361bf1a3c to your computer and use it in GitHub Desktop.
Istio bookinfo-review
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
#!/bin/bash | |
# Verify that k8s is running | |
kubectl label namespace default istio-injection=enabled | |
# 1. Install istio | |
##..... | |
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml | |
# 2. Install bookinfo | |
kubectl apply -f ~/workarea/devopshift/welcome/istio/istio-1.22.1/samples/bookinfo/platform/kube/bookinfo.yaml | |
# 3. Run the dolution | |
kubectl apply -f solution.yaml | |
# Lab 02 | |
kubectl apply -f ~/workarea/devopshift/welcome/istio/istio-1.22.1/samples/bookinfo/platform/kube/bookinfo-versions.yaml | |
apiVersion: gateway.networking.k8s.io/v1beta1 | |
kind: Gateway | |
metadata: | |
name: bookinfo-gateway | |
namespace: default | |
spec: | |
gatewayClassName: istio | |
listeners: | |
- name: http | |
protocol: HTTP | |
port: 80 | |
allowedRoutes: | |
namespaces: | |
from: Same | |
--- | |
apiVersion: gateway.networking.k8s.io/v1beta1 | |
kind: HTTPRoute | |
metadata: | |
name: bookinfo | |
namespace: default | |
spec: | |
parentRefs: | |
- name: bookinfo-gateway | |
rules: | |
- matches: | |
- path: | |
type: Exact | |
value: /productpage | |
backendRefs: | |
- name: productpage | |
port: 9080 | |
- matches: | |
- path: | |
type: PathPrefix | |
value: /static | |
backendRefs: | |
- name: productpage | |
port: 9080 | |
- matches: | |
- path: | |
type: Exact | |
value: /login | |
backendRefs: | |
- name: productpage | |
port: 9080 | |
- matches: | |
- path: | |
type: Exact | |
value: /logout | |
backendRefs: | |
- name: productpage | |
port: 9080 | |
- matches: | |
- path: | |
type: PathPrefix | |
value: /api/v1/products | |
backendRefs: | |
- name: productpage | |
port: 9080 | |
--- | |
apiVersion: gateway.networking.k8s.io/v1 | |
kind: HTTPRoute | |
metadata: | |
name: reviews | |
spec: | |
parentRefs: | |
- name: bookinfo-gateway | |
# The following will override our reviews service endpoint controller and | |
# will pass the traffic only to reviews-v1 | |
- group: "" | |
kind: Service | |
name: reviews | |
port: 9080 | |
rules: | |
- backendRefs: | |
- name: reviews-v1 | |
port: 9080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment