Skip to content

Commit

Permalink
docs: multiple gatewayclass and merge gateways deployment mode (#2881)
Browse files Browse the repository at this point in the history
* docs: multiple gatewayclass and merge gateways deployment mode

Signed-off-by: Karol Szwaj <[email protected]>

* add merged-gateways example

Signed-off-by: Karol Szwaj <[email protected]>

* md lint

Signed-off-by: Karol Szwaj <[email protected]>

* yaml lint

Signed-off-by: Karol Szwaj <[email protected]>

* add user guides

Signed-off-by: Karol Szwaj <[email protected]>

---------

Signed-off-by: Karol Szwaj <[email protected]>
Co-authored-by: Xunzhuo <[email protected]>
  • Loading branch information
cnvergence and Xunzhuo authored Mar 13, 2024
1 parent 45f52e8 commit 0549044
Show file tree
Hide file tree
Showing 3 changed files with 578 additions and 11 deletions.
180 changes: 180 additions & 0 deletions examples/kubernetes/merged-gateways.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: merged-eg
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
parametersRef:
group: gateway.envoyproxy.io
kind: EnvoyProxy
name: custom-proxy-config
namespace: envoy-gateway-system
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
name: custom-proxy-config
namespace: envoy-gateway-system
spec:
mergeGateways: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: merged-backend
---
apiVersion: v1
kind: Service
metadata:
name: merged-backend
labels:
app: merged-backend
service: merged-backend
spec:
ports:
- name: http
port: 3000
targetPort: 3000
selector:
app: merged-backend
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: merged-backend
spec:
replicas: 1
selector:
matchLabels:
app: merged-backend
version: v1
template:
metadata:
labels:
app: merged-backend
version: v1
spec:
serviceAccountName: merged-backend
containers:
- image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231214-v1.0.0-140-gf544a46e
imagePullPolicy: IfNotPresent
name: merged-backend
ports:
- containerPort: 3000
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: merged-eg-1
namespace: default
spec:
gatewayClassName: merged-eg
listeners:
- allowedRoutes:
namespaces:
from: Same
name: http
port: 8080
protocol: HTTP
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: merged-eg-2
namespace: default
spec:
gatewayClassName: merged-eg
listeners:
- allowedRoutes:
namespaces:
from: Same
name: http
port: 8081
protocol: HTTP
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: merged-eg-3
namespace: default
spec:
gatewayClassName: merged-eg
listeners:
- allowedRoutes:
namespaces:
from: Same
name: http
port: 8082
protocol: HTTP
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: hostname1-route
spec:
parentRefs:
- name: merged-eg-1
hostnames:
- "www.merged1.com"
rules:
- backendRefs:
- group: ""
kind: Service
name: backend
port: 3000
weight: 1
matches:
- path:
type: PathPrefix
value: /example
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: hostname2-route
spec:
parentRefs:
- name: merged-eg-2
hostnames:
- "www.merged2.com"
rules:
- backendRefs:
- group: ""
kind: Service
name: backend
port: 3000
weight: 1
matches:
- path:
type: PathPrefix
value: /example2
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: hostname3-route
spec:
parentRefs:
- name: merged-eg-3
hostnames:
- "www.merged3.com"
rules:
- backendRefs:
- group: ""
kind: Service
name: backend
port: 3000
weight: 1
matches:
- path:
type: PathPrefix
value: /example3
5 changes: 2 additions & 3 deletions site/content/en/latest/contributions/design/system-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ The Infra Manager consumes the Infra IR as input to manage the data plane infras

## Design Decisions

* Envoy Gateway consumes one [GatewayClass][gc] by comparing its configured controller name with
`spec.controllerName` of a GatewayClass. If multiple GatewayClasses exist with the same `spec.controllerName`, Envoy
Gateway follows Gateway API [guidelines][gwapi_conflicts] to resolve the conflict.
* Envoy Gateway can consume multiple [GatewayClass][gc] by comparing its configured controller name with
`spec.controllerName` of a GatewayClass.
`gatewayclass.spec.parametersRef` refers to the `EnvoyProxy` custom resource for configuring the managed proxy
infrastructure. If unspecified, default configuration parameters are used for the managed proxy infrastructure.
* Envoy Gateway manages [Gateways][gw] that reference its GatewayClass.
Expand Down
Loading

0 comments on commit 0549044

Please sign in to comment.