Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#46 from GoogleCloudPlatform/update…
Browse files Browse the repository at this point in the history
…-docs-reference-manifests

updating YAMLs referenced by Gateway controller docs pages
  • Loading branch information
boredabdel authored Jun 14, 2021
2 parents 4acc29f + b96749a commit 8ebcac3
Show file tree
Hide file tree
Showing 11 changed files with 245 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: internal-http
namespace: store
spec:
gatewayClassName: gke-l7-rilb-mc
listeners:
- protocol: HTTP
port: 80
routes:
kind: HTTPRoute
selector:
matchLabels:
gateway: internal-http
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: internal-store-route
namespace: store
labels:
gateway: internal-http
spec:
hostnames:
- "store.example.internal"
rules:
# Matches for env=canary and sends it to store-west-2 ServiceImport
- matches:
- headers:
values:
env: canary
forwardTo:
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-2
port: 8080
# All other traffic goes to store-west-1 ServiceImport
- forwardTo:
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-1
port: 8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: internal-store-route
namespace: store
labels:
gateway: internal-http
spec:
hostnames:
- "store.example.internal"
rules:
# Sends all traffic to store-west-1 ServiceImport
- forwardTo:
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-1
port: 8080
# Also mirrors all traffic to store-west-2 ServiceImport
filters:
- type: RequestMirror
requestMirror:
backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-2
port: 8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: internal-store-route
namespace: store
labels:
gateway: internal-http
spec:
hostnames:
- "store.example.internal"
rules:
# 90% of traffic to store-west-1 ServiceImport
- forwardTo:
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-1
port: 8080
weight: 90
# 10% of traffic to store-west-2 ServiceImport
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-2
port: 8080
weight: 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: internal-store-route
namespace: store
labels:
gateway: internal-http
spec:
hostnames:
- "store.example.internal"
rules:
# No traffic to store-west-1 ServiceImport
- forwardTo:
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-1
port: 8080
weight: 0
# All traffic to store-west-2 ServiceImport
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-2
port: 8080
weight: 100
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: internal-http
namespace: store
spec:
gatewayClassName: gke-l7-rilb-mc
listeners:
- protocol: HTTP
port: 80
routes:
kind: HTTPRoute
selector:
matchLabels:
gateway: internal-http
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: public-store-route
namespace: store
labels:
gateway: external-http
spec:
hostnames:
- "store.example.com"
rules:
- forwardTo:
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store
port: 8080
- matches:
- path:
type: Prefix
value: /west
forwardTo:
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-west-1
port: 8080
- matches:
- path:
type: Prefix
value: /east
forwardTo:
- backendRef:
group: net.gke.io
kind: ServiceImport
name: store-east-1
port: 8080
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: Service
metadata:
name: store
namespace: store
spec:
selector:
app: store
ports:
- port: 8080
targetPort: 8080
---
kind: ServiceExport
apiVersion: net.gke.io/v1
metadata:
name: store
namespace: store
---
apiVersion: v1
kind: Service
metadata:
name: store-west-1
namespace: store
spec:
selector:
app: store
ports:
- port: 8080
targetPort: 8080
---
kind: ServiceExport
apiVersion: net.gke.io/v1
metadata:
name: store-west-1
namespace: store
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: Service
metadata:
name: store
namespace: store
spec:
selector:
app: store
ports:
- port: 8080
targetPort: 8080
---
kind: ServiceExport
apiVersion: net.gke.io/v1
metadata:
name: store
namespace: store
---
apiVersion: v1
kind: Service
metadata:
name: store-west-2
namespace: store
spec:
selector:
app: store
ports:
- port: 8080
targetPort: 8080
---
kind: ServiceExport
apiVersion: net.gke.io/v1
metadata:
name: store-west-2
namespace: store

0 comments on commit 8ebcac3

Please sign in to comment.