Skip to content

Commit 0ba583e

Browse files
authored
docs: add gateway namespace mode documentation (#6040)
* docs: add gateway namespace mode documentation Signed-off-by: Karol Szwaj <[email protected]> * fix lint Signed-off-by: Karol Szwaj <[email protected]> * fix review Signed-off-by: Karol Szwaj <[email protected]> * add to 1.4 Signed-off-by: Karol Szwaj <[email protected]> * add example description Signed-off-by: Karol Szwaj <[email protected]> * rename section Signed-off-by: Karol Szwaj <[email protected]> * review update Signed-off-by: Karol Szwaj <[email protected]> * review update Signed-off-by: Karol Szwaj <[email protected]> * change to helm chart values Signed-off-by: Karol Szwaj <[email protected]> --------- Signed-off-by: Karol Szwaj <[email protected]>
1 parent 31821a9 commit 0ba583e

File tree

5 files changed

+760
-4
lines changed

5 files changed

+760
-4
lines changed
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
apiVersion: gateway.networking.k8s.io/v1
2+
kind: GatewayClass
3+
metadata:
4+
name: eg
5+
spec:
6+
controllerName: gateway.envoyproxy.io/gatewayclass-controller
7+
---
8+
apiVersion: v1
9+
kind: ServiceAccount
10+
metadata:
11+
name: team-a-backend
12+
namespace: team-a
13+
---
14+
apiVersion: v1
15+
kind: Service
16+
metadata:
17+
name: team-a-backend
18+
namespace: team-a
19+
labels:
20+
app: team-a-backend
21+
service: team-a-backend
22+
spec:
23+
ports:
24+
- name: http
25+
port: 3000
26+
targetPort: 3000
27+
selector:
28+
app: team-a-backend
29+
---
30+
apiVersion: apps/v1
31+
kind: Deployment
32+
metadata:
33+
name: team-a-backend
34+
namespace: team-a
35+
spec:
36+
replicas: 1
37+
selector:
38+
matchLabels:
39+
app: team-a-backend
40+
version: v1
41+
template:
42+
metadata:
43+
labels:
44+
app: team-a-backend
45+
version: v1
46+
spec:
47+
serviceAccountName: team-a-backend
48+
containers:
49+
- image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231214-v1.0.0-140-gf544a46e
50+
imagePullPolicy: IfNotPresent
51+
name: team-a-backend
52+
ports:
53+
- containerPort: 3000
54+
env:
55+
- name: POD_NAME
56+
valueFrom:
57+
fieldRef:
58+
fieldPath: metadata.name
59+
- name: NAMESPACE
60+
valueFrom:
61+
fieldRef:
62+
fieldPath: metadata.namespace
63+
---
64+
apiVersion: v1
65+
kind: ServiceAccount
66+
metadata:
67+
name: team-b-backend
68+
namespace: team-b
69+
---
70+
apiVersion: v1
71+
kind: Service
72+
metadata:
73+
name: team-b-backend
74+
namespace: team-b
75+
labels:
76+
app: team-b-backend
77+
service: team-b-backend
78+
spec:
79+
ports:
80+
- name: http
81+
port: 3000
82+
targetPort: 3000
83+
selector:
84+
app: team-b-backend
85+
---
86+
apiVersion: apps/v1
87+
kind: Deployment
88+
metadata:
89+
name: team-b-backend
90+
namespace: team-b
91+
spec:
92+
replicas: 1
93+
selector:
94+
matchLabels:
95+
app: team-b-backend
96+
version: v1
97+
template:
98+
metadata:
99+
labels:
100+
app: team-b-backend
101+
version: v1
102+
spec:
103+
serviceAccountName: team-b-backend
104+
containers:
105+
- image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231214-v1.0.0-140-gf544a46e
106+
imagePullPolicy: IfNotPresent
107+
name: team-b-backend
108+
ports:
109+
- containerPort: 3000
110+
env:
111+
- name: POD_NAME
112+
valueFrom:
113+
fieldRef:
114+
fieldPath: metadata.name
115+
- name: NAMESPACE
116+
valueFrom:
117+
fieldRef:
118+
fieldPath: metadata.namespace
119+
---
120+
apiVersion: gateway.networking.k8s.io/v1
121+
kind: Gateway
122+
metadata:
123+
name: gateway-a
124+
namespace: team-a
125+
spec:
126+
gatewayClassName: eg
127+
listeners:
128+
- allowedRoutes:
129+
namespaces:
130+
from: Same
131+
name: http
132+
port: 8080
133+
protocol: HTTP
134+
---
135+
apiVersion: gateway.networking.k8s.io/v1
136+
kind: Gateway
137+
metadata:
138+
name: gateway-b
139+
namespace: team-b
140+
spec:
141+
gatewayClassName: eg
142+
listeners:
143+
- allowedRoutes:
144+
namespaces:
145+
from: Same
146+
name: http
147+
port: 8081
148+
protocol: HTTP
149+
---
150+
apiVersion: gateway.networking.k8s.io/v1
151+
kind: HTTPRoute
152+
metadata:
153+
name: team-a-route
154+
namespace: team-a
155+
spec:
156+
parentRefs:
157+
- name: gateway-a
158+
hostnames:
159+
- "www.team-a.com"
160+
rules:
161+
- backendRefs:
162+
- group: ""
163+
kind: Service
164+
name: team-a-backend
165+
port: 3000
166+
weight: 1
167+
matches:
168+
- path:
169+
type: PathPrefix
170+
value: /example
171+
---
172+
apiVersion: gateway.networking.k8s.io/v1
173+
kind: HTTPRoute
174+
metadata:
175+
name: team-b-route
176+
namespace: team-b
177+
spec:
178+
parentRefs:
179+
- name: gateway-b
180+
hostnames:
181+
- "www.team-b.com"
182+
rules:
183+
- backendRefs:
184+
- group: ""
185+
kind: Service
186+
name: team-b-backend
187+
port: 3000
188+
weight: 1
189+
matches:
190+
- path:
191+
type: PathPrefix
192+
value: /example

site/content/en/latest/tasks/operations/deployment-mode.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ title: "Deployment Mode"
44
## Deployment modes
55

66
### One GatewayClass per Envoy Gateway Controller
7+
78
* An Envoy Gateway is associated with a single [GatewayClass][] resource under one controller.
89
This is the simplest deployment mode and is suitable for scenarios where each Gateway needs to have its own dedicated set of resources and configurations.
910

1011
### Multiple GatewayClasses per Envoy Gateway Controller
12+
1113
* An Envoy Gateway is associated with multiple [GatewayClass][] resources under one controller.
1214
* Support for accepting multiple GatewayClasses was added [here][issue1231].
1315

1416
### Separate Envoy Gateway Controllers
17+
1518
If you've instantiated multiple GatewayClasses, you can also run separate Envoy Gateway controllers in different namespaces, linking a GatewayClass to each of them for multi-tenancy.
1619
Please follow the example [Multi-tenancy](#multi-tenancy).
1720

1821
### Merged Gateways onto a single EnvoyProxy fleet
22+
1923
By default, each Gateway has its own dedicated set of Envoy Proxy and its configurations.
2024
However, for some deployments, it may be more convenient to merge listeners across multiple Gateways and deploy a single Envoy Proxy fleet.
2125

@@ -26,6 +30,14 @@ Setting the `mergeGateways` field in the EnvoyProxy resource linked to GatewayCl
2630

2731
Please follow the example [Merged gateways deployment](#merged-gateways-deployment).
2832

33+
### Gateway Namespace Mode
34+
35+
Gateway Namespace Mode is a deployment model for Envoy Gateway that creates Envoy Proxy infrastructure resources like Deployments, Services and ServiceAccounts in the namespace where each Gateway resource is defined, rather than in the Envoy Gateway controller namespace.
36+
37+
* Support for this deployment mode was added [here][issue2629].
38+
39+
Please follow the example [Gateway Namespace Mode][].
40+
2941
### Supported Modes
3042

3143
#### Kubernetes
@@ -34,7 +46,6 @@ Please follow the example [Merged gateways deployment](#merged-gateways-deployme
3446
and **creates** managed data plane resources such as EnvoyProxy `Deployment` in the **namespace where Envoy Gateway is running**.
3547
* Envoy Gateway also supports [Namespaced deployment mode][], you can watch resources in the specific namespaces by assigning
3648
`EnvoyGateway.provider.kubernetes.watch.namespaces` or `EnvoyGateway.provider.kubernetes.watch.namespaceSelector` and **creates** managed data plane resources in the **namespace where Envoy Gateway is running**.
37-
* Support for alternate deployment modes is being tracked [here][issue1117].
3849

3950
### Multi-tenancy
4051

@@ -1068,5 +1079,6 @@ curl --header "Host: www.merged3.com" http://$GATEWAY_HOST:8082/example3
10681079
[EnvoyProxy]: ../../api/extension_types#envoyproxy
10691080
[GatewayClass]: https://gateway-api.sigs.k8s.io/api-types/gatewayclass/
10701081
[Namespaced deployment mode]: ../../api/extension_types#kuberneteswatchmode
1082+
[Gateway Namespace Mode]: ./gateway-namespace-mode
10711083
[issue1231]: https://github.com/envoyproxy/gateway/issues/1231
1072-
[issue1117]: https://github.com/envoyproxy/gateway/issues/1117
1084+
[issue2629]: https://github.com/envoyproxy/gateway/issues/2629

0 commit comments

Comments
 (0)