@@ -15,12 +15,13 @@ using a Service of type LoadBalancer fronting a Kubernetes pod running a
15
15
proxy. This is simple to reason about, easy to manage for sidecar meshes, and
16
16
will presumably be an important implementation mechanism for the foreseeable
17
17
future. Some cloud providers, though, are moving the proxy outside of the
18
- cluster, for various reasons which are out of the scope of this GEP. Chihiro
19
- and Ian want to be able to use these out-of-cluster proxies effectively and
18
+ cluster, for various reasons which are out of the scope of this GEP. [ Chihiro]
19
+ and [ Ian] want to be able to use these out-of-cluster proxies effectively and
20
20
safely, though they recognize that this may require additional configuration.
21
21
22
- [ Chihiro ] : https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/#chihiro
23
- [ Ian ] : https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/#ian
22
+ [ Chihiro ] : https://https//gateway-api.sigs.k8s.io/concepts/roles-and-personas/#chihiro
23
+ [ Ian ] : https://https//gateway-api.sigs.k8s.io/concepts/roles-and-personas/#ian
24
+ [ Ana ] : https://https//gateway-api.sigs.k8s.io/concepts/roles-and-personas/#ana
24
25
25
26
### Nomenclature and Background
26
27
@@ -74,8 +75,8 @@ In this GEP:
74
75
75
76
## Goals
76
77
77
- - Allow Chihiro and Ian to configure an OCG and a mesh such that the OCG can
78
- usefully participate in the mesh, including:
78
+ - Allow [ Chihiro] and [ Ian] to configure an OCG and a mesh such that the OCG
79
+ can usefully participate in the mesh, including:
79
80
80
81
- The OCG must be able to securely communicate with meshed workloads in
81
82
the cluster, where "securely communicate" includes encryption,
@@ -91,8 +92,8 @@ In this GEP:
91
92
- The OCG must be able to distinguish meshed workloads from non-meshed
92
93
workloads, so that it can communicate appropriately with each.
93
94
94
- - Allow Ana to develop and operate meshed applications without needing to know
95
- whether the Gateway she's using is an OCG or an in-cluster Gateway.
95
+ - Allow [ Ana] to develop and operate meshed applications without needing to
96
+ know whether the Gateway she's using is an OCG or an in-cluster Gateway.
96
97
97
98
- Define a basic set of requirements for OCGs and meshes that want to
98
99
interoperate with each other (for example, the OCG and the mesh will likely
@@ -162,7 +163,7 @@ configuration.
162
163
163
164
To allow the OCG to _ usefully_ participate in the mesh, we need to solve at
164
165
least four significant problems. Thankfully, these are mostly problems for
165
- Chihiro -- if we do our jobs correctly, Ana will never need to know.
166
+ [ Chihiro] -- if we do our jobs correctly, [ Ana] will never need to know.
166
167
167
168
#### 1. The Trust Problem
168
169
@@ -224,20 +225,6 @@ OCG or other meshed workloads, you'll need to either provide two Routes with
224
225
the same configuration, or you'll need to provide a single Route with multiple
225
226
` parentRef ` s.
226
227
227
- ## API
228
-
229
- Most of the API work for this GEP is TBD at this point, but there are two
230
- important points to note:
231
-
232
- First, Gateway API has never defined a Mesh resource because, to date, it's
233
- never been clear what would go into it. This may be the first configuration
234
- item that causes us to need a Mesh resource.
235
-
236
- Second, since the API should affect only Gateway API resources, it is not a
237
- good candidate for policy attachment. It is likely to be much more reasonable
238
- to simply provide whatever extra configuration we need inline in the Gateway
239
- or Mesh resources.
240
-
241
228
## Graduation Criteria
242
229
243
230
In addition to the [ general graduation
@@ -246,16 +233,254 @@ guarantee that **all four** of the problems listed above need resolutions, and
246
233
must have implementation from at least two different Gateways and two
247
234
different meshes.
248
235
249
- ### Gateway for Ingress (North/South)
236
+ ## API
237
+
238
+ There are three important aspects to the OCG API:
239
+
240
+ 1 . The API must allow the OCG to be configured to securely communicate with
241
+ meshed workloads in the cluster, including providing the OCG with the
242
+ information it needs to authenticate itself as a workload.
243
+
244
+ 2 . The API must allow the mesh to be configured to accept requests from the
245
+ OCG, including providing the mesh with the information it needs to
246
+ authenticate the OCG as a workload.
247
+
248
+ 3 . Since the API should affect only Gateway API resources, it is not a good
249
+ candidate for policy attachment. It is likely to be much more reasonable to
250
+ simply provide whatever extra configuration we need inline in the Gateway
251
+ or Mesh resources.
252
+
253
+ The API must also solve all four of the problems listed above, so we'll start
254
+ with an overview of the solutions before diving into the API details.
255
+
256
+ ### Solving the Trust Problem
257
+
258
+ The trust problem is that the OCG and the mesh need to be able to trust each
259
+ other. The simplest solution to this problem is to add a _ trust bundle_ the
260
+ Gateway resource, and to create a Mesh resource which will also have a trust
261
+ bundle:
262
+
263
+ - The trust bundle in the Gateway resource will define the CA certificate(s)
264
+ that the OCG should trust when communicating with meshed workloads in the
265
+ cluster.
266
+
267
+ - The trust bundle in the Mesh resource will define the CA certificate(s)
268
+ that the mesh should trust when communicating with the OCG.
269
+
270
+ This is a straightforward way to permit each component to verify the identity
271
+ of the other, which will provide sufficient basis for verifying identity when
272
+ mTLS meshes are involved.
273
+
274
+ - An alternative would be to define a single trust bundle, requiring the OCG
275
+ and the mesh to each use the same CA certificate. This adds considerable
276
+ operational complexity (especially in the world of enterprise PKI) without
277
+ any real benefit.
278
+
279
+ ### Solving the Protocol Problem
280
+
281
+ The protocol problem is that the OCG needs a way to indicate to the mesh that
282
+ it intends to participate in the mesh for a given connection, and the mesh
283
+ needs to accept the OCG's participation.
284
+
285
+ As a starting point for OCG/mTLS mesh interaction:
286
+
287
+ - The OCG MUST use an mTLS connection to communicate with meshed workloads.
288
+
289
+ - The OCG MUST use an mTLS certificate ultimately signed by a certificate in
290
+ the trust bundle provided to the mesh.
291
+
292
+ - The mesh MUST use an mTLS certificate ultimately signed by a certificate in
293
+ the trust bundle provided to the OCG.
294
+
295
+ - The OCG MUST send the ` ocg.gateway.networking.k8s.io/v1 ` ALPN protocol
296
+ during mTLS negotiation. The mesh MUST interpret this ALPN selection as a
297
+ signal that the OCG intends to participate in the mesh.
298
+
299
+ - The OCG MUST NOT send any additional information in the data stream before
300
+ client data. (This is a contrast from e.g. Linkerd's default behavior, and
301
+ has implications for the outbound behavior problem.)
302
+
303
+ This will (obviously) require implementation work on the part of both the OCG
304
+ implementations and the mesh implementations, so it's worth looking at some
305
+ alternatives.
306
+
307
+ - The OCG could be required to exactly mimic the ALPN/transport metadata
308
+ combination used by an existing mesh. However, the existing meshes don't
309
+ share a single common mechanism, so this would require a lot of work on the
310
+ OCG's part, and it wouldn't be portable between meshes.
311
+
312
+ - The OCG could simply skip ALPN, and hand a "bare" mTLS connection to the
313
+ mesh. In general, existing meshes don't support this in the way that we
314
+ want: depending on the destination of the connection, they may interpret it
315
+ as application-level mTLS that they should treat as an opaque data stream,
316
+ or they may simply refuse it. This alternative, therefore, both shifts the
317
+ entire burden of implementation to the meshes, and probably makes it
318
+ impossible to correctly handle application-level mTLS.
319
+
320
+ (Whether meshes _ should_ support application-level mTLS in this way is a
321
+ separate discussion, and is out of scope for this GEP.)
322
+
323
+ - We could perhaps abuse the [ PROXY protocol] for this, or define something
324
+ similar. This would appear to increase the implementation burden on both
325
+ sides without providing appreciable benefit.
326
+
327
+ [ PROXY protocol ] : https://github.com/haproxy/haproxy/blob/master/doc/proxy-protocol.txt
250
328
251
- ### Gateway For Mesh (East/West)
329
+ None of these alternatives would appear to be better than using ALPN in a
330
+ similar way to how (some) existing meshes already use it.
331
+
332
+ ### Solving the Discovery Problem
333
+
334
+ The discovery problem is that not every workload in the cluster is required to
335
+ be meshed, which means that the OCG needs a way to know whether a given
336
+ connection must participate in the mesh or not. In practice, this isn't
337
+ actually a question of _ workloads_ but of _ Routes_ : the point of interface
338
+ between a Gateway and a workload in the cluster is not a Pod or a Service, but
339
+ rather a Route.
340
+
341
+ We could approach this in a few different ways:
342
+
343
+ 1 . Assume that _ all_ Routes in the cluster are meshed. This is obviously a
344
+ nonstarter.
345
+
346
+ 2 . Assume that _ all_ Routes bound to the OCG are meshed. This is also a
347
+ nonstarter.
348
+
349
+ 3 . Add a field to the Route resource that indicates whether the Route is
350
+ meshed. This feels like quite a bit of an imposition on [ Ana] (and, again,
351
+ if we do our jobs correctly, [ Ana] shouldn't need to think about this).
352
+
353
+ 4 . Add a field to the Gateway resource that enumerates Routes that are meshed.
354
+ This would be a lot of work for [ Chihiro] and [ Ian] to maintain; while
355
+ that's better than putting the burden on [ Ana] , it still isn't good.
356
+
357
+ 5 . Add a field to the Gateway resource that enumerates namespaces that are
358
+ meshed. This isn't quite as bad as option 4, but it's still a lot of work
359
+ for [ Chihiro] and [ Ian] , _ and_ it limits us to only having entire
360
+ namespaces meshed.
361
+
362
+ 6 . Add a label selector to the Gateway resource and declare that Routes with
363
+ the label, and Routes in namespaces with the label, are meshed.
364
+
365
+ Overall, option 6 is probably the least imposition on everyone:
366
+
367
+ - It's still an active choice, rather than assuming things about the whole
368
+ cluster.
369
+
370
+ - It allows operating at the namespace level or at the Route level.
371
+
372
+ - It takes advantage of the case where a mesh already uses a label to indicate
373
+ which resources are meshed.
374
+
375
+ - It uses a reasonably Kubernetes-native mechanism for selection.
376
+
377
+ Therefore, we'll add a label selector to the Gateway resource, and OCG MUST
378
+ assume that any Route that either matches this selector, or is in a namespace
379
+ that matches this selector, is meshed.
380
+
381
+ ### Solving the Outbound Behavior Problem
382
+
383
+ The outbound behavior problem is that the OCG will need to speak directly to
384
+ endpoints in the cluster, which will prevent most meshes from being able to
385
+ apply outbound behaviors directly.
386
+
387
+ As a starting point, we will explicitly declare that the OCG is responsible
388
+ for all outbound behaviors for meshed requests, and that it is OK for the mesh
389
+ to not be able to apply these behaviors. This leaves the UX problem that a
390
+ Route meant to apply equally to N/S traffic and E/W traffic will involve some
391
+ duplication of configuration, but all the alternatives create operational
392
+ problems.
393
+
394
+ - If the mesh is responsible for all outbound behaviors, what happens if the
395
+ OCG needs to speak to a non-meshed Route? Would we require [ Ana] to
396
+ duplicate the Route, or (arguably worse) require the OCG to interpret GAMMA
397
+ Routes?
398
+
399
+ - If the OCG and the mesh share responsibility in some way, how do we describe
400
+ the split?
401
+
402
+ Overall, the alternatives to the OCG being responsible for all outbound
403
+ behaviors for requests leaving the OCG would all seem to create much worse
404
+ problems than the UX problem of having to duplicate configuration for a Route
405
+ that applies equally to N/S and E/W traffic.
406
+
407
+ ### API Details (North/South)
408
+
409
+ Since the OCG itself is assumed to be a conformant Gateway API implementation,
410
+ we can extend the Gateway resource to include the necessary configuration for
411
+ the OCG to securely communicate with meshed workloads in the cluster. We'll
412
+ add a new ` mesh ` field to the Gateway resource, which will currently allow
413
+ specifying two things:
414
+
415
+ 1 . A trust bundle that contains the CA certificate(s) that the OCG should use
416
+ to verify workloads in the mesh.
417
+
418
+ 2 . A label selector that allows the OCG to find namespaces that are meshed.
419
+
420
+ For example:
421
+
422
+ ``` yaml
423
+ apiVersion : networking.x-k8s.io/v1
424
+ kind : Gateway
425
+ metadata :
426
+ name : ocg-gateway
427
+ spec :
428
+ gatewayClassName : ocg-gateway-class
429
+ ...
430
+ mesh : # All mesh-related configuration goes here
431
+ trustBundle :
432
+ # List of SecretObjectReference; at least one is required
433
+ - name : ocg-mesh-root-ca # mandatory
434
+ namespace : ocg-mesh-namespace # defaults to the Gateway's namespace
435
+ - ...
436
+ selector :
437
+ matchLabels :
438
+ linkerd.io/inject : " true" # or whatever label is appropriate
439
+ ` ` `
440
+
441
+ ### API Details (East/West)
442
+
443
+ We'll define a new Mesh resource to allow the mesh to be configured to accept
444
+ requests from the OCG. The Mesh resource will allow specifying a trust bundle
445
+ that contains the CA certificate(s) that the mesh should use to verify
446
+ requests from the OCG.
447
+
448
+ (The Mesh resource should clearly also have a way for the mesh implementation
449
+ to indicate supported features, in parallel to the GatewayClass resource, but
450
+ that will be a separate GEP.)
451
+
452
+ Note that the Mesh resource doesn't need a selector for meshed workloads: the
453
+ mesh implementation will already understand this.
454
+
455
+ For example:
456
+
457
+ ` ` ` yaml
458
+ apiVersion : networking.x-k8s.io/v1
459
+ kind : Mesh
460
+ metadata :
461
+ name : ocg-mesh
462
+ spec :
463
+ ocg : # All OCG-related configuration goes here
464
+ trustBundle :
465
+ # List of SecretObjectReference; at least one is required
466
+ - name : ocg-mesh-root-ca # mandatory
467
+ namespace : ocg-mesh-namespace # defaults to the Mesh's namespace
468
+ - ...
469
+ ` ` `
470
+
471
+ ### API Type Definitions
472
+
473
+ TBA.
252
474
253
475
## Conformance Details
254
476
477
+ TBA.
478
+
255
479
#### Feature Names
256
480
257
- This GEP will use the feature name ` MeshOffClusterGateway ` , under the
258
- assumption that we will indeed need a Mesh resource.
481
+ This GEP will use the feature name ` OffClusterGateway`, and MUST be listed in
482
+ both the `Gateway` and `Mesh` resources, so that [Chihiro] can know that
483
+ they're choosing a combination of OCG and mesh that will work together.
259
484
260
485
# ## Conformance tests
261
486
0 commit comments