@@ -223,11 +223,14 @@ List the specific goals of the KEP. What is it trying to achieve? How will we
223
223
know that this has succeeded?
224
224
-->
225
225
226
- Come up with a plan for:
227
-
228
- * Where to create the KRM functions repo/registry.
229
- * How to manage the KRM functions repo/registry.
230
- * How to standardize the metadata for a KRM function.
226
+ * Enable end users of orchestrators (e.g. Kustomize, Kpt) that support KRM
227
+ functions to discover and leverage a common ecosystem of compatible functions.
228
+ * Enable end users to discover and use sets of functions specifically from
229
+ publishers they trust.
230
+ * Enable function authors from any company to expose their function in a
231
+ well-known index for discovery by end users.
232
+ * Provide a central place for first-party (SIG-sponsored) plugins to be built
233
+ and added to the index.
231
234
232
235
### Non-Goals
233
236
@@ -236,8 +239,12 @@ What is out of scope for this KEP? Listing non-goals helps to focus discussion
236
239
and make progress.
237
240
-->
238
241
239
- Design the detailed format of the metadata of a KRM function. It should be
240
- designed separately.
242
+ * Replace or compete with Catalog as publication format for collections of
243
+ functions. Catalog should be used by this Registry, and the details of its
244
+ internal format should be discussed in that KEP.
245
+ * Support building non-SIG-sponsored functions.
246
+ * Support SIG-sponsored functions written in a language other than Go or
247
+ published in a format other than containerized.
241
248
242
249
## Proposal
243
250
@@ -281,7 +288,8 @@ CI can be set up to enforce verifiable commit from desired email domain.
281
288
282
289
### Security
283
290
284
- SIG-CLI is NOT responsible for the security of their KRM functions.
291
+ SIG-CLI is responsible for the security of the SIG-sponsored KRM functions but
292
+ not all KRM functions in the registry.
285
293
286
294
Publishers are responsible for the security of their KRM functions. Publishers
287
295
are responsible for clearly communicating the expectation (e.g. maturity) to
@@ -293,8 +301,11 @@ be published as _kutomize-experimental_. We can also consider using hierarchy in
293
301
publishers. E.g. _ kustomize/default_ for the former set and
294
302
_ kustomize/experimental_ for the latter.
295
303
296
- If some functions don't have any publishers, the users should use it at their
297
- own risk.
304
+ Some contributors (e.g. students) may not want to publish KRM functions on
305
+ behalf of any publishers, but we will require the maintainer information be
306
+ included in the metadata of the functions and the maintainers are responsible
307
+ for the security of their KRM functions. For the functions that don't have any
308
+ publishers, the users should use it at their own risk.
298
309
299
310
We strongly suggest users to use container as a sandboxing mechanism to run the
300
311
KRM functions.
@@ -306,9 +317,12 @@ A user should NOT trust every KRM function in the registry.
306
317
Trust can be established at the publisher level. Users can choose to trust a
307
318
publisher and use the KRM functions provided by this publisher.
308
319
309
- Publisher information can be used to aggregate KRM functions. For example, I can
310
- query https://krm-fn-registry.sigs.k8s.io/catalog.yaml?publisher=kustomize,kubeflow
311
- to find all the KRM functions offered by Kustomize and KubeFlow.
320
+ Publisher information can be used to aggregate KRM functions. We can support
321
+ both dynamic aggregation of KRM functions and static, versioned collection of
322
+ KRM functions. Publishers can choose to create a snapshot of the dynamic
323
+ aggregation of their KRM functions at some time. The snapshot must be versioned,
324
+ but SemVer is not necessary here since it's meaningless for a catalog. The
325
+ snapshot can be accessed later as a static catalog.
312
326
313
327
### User Stories (Optional)
314
328
@@ -324,30 +338,54 @@ bogged down.
324
338
As a KRM functions user, I can browse the function registry website (e.g.
325
339
https://krm-fn-registry.sigs.k8s.io ) and search the KRM function by name (e.g.
326
340
set-labels). And I can find everything including doc, examples, homepage,
327
- maintainers information about the function.
341
+ maintainers, publisher information about the function.
328
342
329
343
#### Story 2
330
344
331
- As a KRM function user, I can find all KRM functions published by Example Co.
332
- The metadata for these functions can be aggregated and served by the website.
345
+ As a KRM function user, I can query
346
+ https://krm-fn-registry.sigs.k8s.io/catalogs/aggregate/latest.yaml?publisher=kubeflow,kustomize
347
+ to find a real-time aggregation of all KRM functions published by Kustomize and
348
+ KubeFlow.
333
349
334
350
#### Story 3
335
351
336
- As a kustomize user, I can use the KRM functions provided by a publisher as
337
- [ a catalog with kustomize] ( https://github.com/kubernetes/enhancements/pull/2954/files#diff-da31478d2b3a925c17471e989c953539b508eed0aae19d624ad943d08f4dd910R414-R415 ) .
338
- The ` kustomiztion.yaml ` file may look like:
352
+ As a KRM function user, I can find the versioned catalog published by Pineapple
353
+ Co. at
354
+ https://krm-fn-registry.sigs.k8s.io/catalogs/pineapple/v20210924.yaml .
355
+ It is a catalog provided by Pineapple Co. and snapshoted on 09/24/2021.
356
+
357
+ #### Story 4
358
+
359
+ As a kustomize user, I want to use a KRM functions catalog provided by a
360
+ publisher in kustomize.
361
+ The ` kustomiztion.yaml ` file may look like the following per [ Catalog KEP] ( https://github.com/kubernetes/enhancements/pull/2954/files#diff-da31478d2b3a925c17471e989c953539b508eed0aae19d624ad943d08f4dd910R414-R415 )
339
362
340
363
```
341
364
apiVersion: kustomize.config.k8s.io/v1beta1
342
365
kind: Kustomization
343
366
catalogs:
344
- - https://krm-fn-registry.sigs.k8s.io/catalog .yaml?publisher=kustomize
367
+ - https://krm-fn-registry.sigs.k8s.io/catalogs/kustomize/v20210924 .yaml.
345
368
resources:
346
369
- input.yaml
347
370
transformers:
348
371
- ...
349
372
```
350
373
374
+ #### Story 5
375
+
376
+ As a KRM function user, I want to have tab completion for function image names
377
+ when using imperative runs. The sugguested image names should from the registry.
378
+
379
+ When using with kustomize:
380
+ ``` shell
381
+ kustomize fn run --image < tab><tab>
382
+ ```
383
+
384
+ When using with kpt:
385
+ ``` shell
386
+ kpt fn eval --image < tab><tab>
387
+ ```
388
+
351
389
### Notes/Constraints/Caveats (Optional)
352
390
353
391
<!--
@@ -374,6 +412,12 @@ Consider including folks who also work outside the SIG or subproject.
374
412
Security might be a potential risk here. We have introduced the publisher
375
413
concept to mitigate the risk.
376
414
415
+ The dynamic generation of catalogs (e.g. from a versionless URL with a query
416
+ param), if supported and used in declarative configs, would lead to
417
+ non-reproducible builds.
418
+ To mitigate it, we would strongly suggest users to use versioned catalogs from
419
+ the registry in production.
420
+
377
421
## Design Details
378
422
379
423
<!--
@@ -466,7 +510,8 @@ We can mix the 2 management models above.
466
510
We can manage the source code of the Kustomize provided KRM functions in-tree.
467
511
Generic KRM functions like set-labels, set-annotations and set-namespace can be
468
512
included. All the KRM functions provided by kustomize must go through a security
469
- audit.
513
+ audit. These in-tree KRM funcitons can serve as examples for other publishers
514
+ about how to organize their functions.
470
515
471
516
The model of centralized index with distributed release is more flexible and
472
517
more suitable for all vendors and other contributors. We can manage the source
@@ -476,6 +521,15 @@ All KRM functions in the registry must provide the metadata in the repo. We must
476
521
standardize the metadata format for KRM functions, since we will require all
477
522
contributors to follow it. A website can be built using the metadata information.
478
523
524
+ ### Website
525
+
526
+ The website code will live in the registry as well.
527
+ Ideally, we don't need to check generated html files in the repo. We can use
528
+ tools to generate the site from Markdown files.
529
+
530
+ Kpt site is using [ docsify] ( https://docsify.js.org/#/ ) and kubebuilder site is
531
+ using [ mdBook] ( https://github.com/rust-lang/mdBook ) .
532
+
479
533
### Test Plan
480
534
481
535
<!--
@@ -496,8 +550,12 @@ when drafting this test plan.
496
550
[testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
497
551
-->
498
552
499
- Simple smoke tests can be set up to ensure the functions are compliant with the
500
- [ KRM functions spec] .
553
+ For the sig-sponsored KRM functions, they should be tested in-tree. And if we
554
+ develop a test harness, it should live in-tree. If kustomize has an existing
555
+ test harness, we can leverage it or move it to the registry repo.
556
+
557
+ For KRM functions that are not sig-sponsored, the maintainers are responsible
558
+ for testing them.
501
559
502
560
### Graduation Criteria
503
561
0 commit comments