Skip to content

Commit 75ac46a

Browse files
author
Mengqi Yu
committed
address comments
1 parent 2121c89 commit 75ac46a

File tree

1 file changed

+81
-23
lines changed
  • keps/sig-cli/2985-public-krm-functions-registry

1 file changed

+81
-23
lines changed

keps/sig-cli/2985-public-krm-functions-registry/README.md

Lines changed: 81 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,14 @@ List the specific goals of the KEP. What is it trying to achieve? How will we
223223
know that this has succeeded?
224224
-->
225225

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.
231234

232235
### Non-Goals
233236

@@ -236,8 +239,12 @@ What is out of scope for this KEP? Listing non-goals helps to focus discussion
236239
and make progress.
237240
-->
238241

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.
241248

242249
## Proposal
243250

@@ -281,7 +288,8 @@ CI can be set up to enforce verifiable commit from desired email domain.
281288

282289
### Security
283290

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.
285293

286294
Publishers are responsible for the security of their KRM functions. Publishers
287295
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
293301
publishers. E.g. _kustomize/default_ for the former set and
294302
_kustomize/experimental_ for the latter.
295303

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.
298309

299310
We strongly suggest users to use container as a sandboxing mechanism to run the
300311
KRM functions.
@@ -306,9 +317,12 @@ A user should NOT trust every KRM function in the registry.
306317
Trust can be established at the publisher level. Users can choose to trust a
307318
publisher and use the KRM functions provided by this publisher.
308319

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.
312326

313327
### User Stories (Optional)
314328

@@ -324,30 +338,54 @@ bogged down.
324338
As a KRM functions user, I can browse the function registry website (e.g.
325339
https://krm-fn-registry.sigs.k8s.io) and search the KRM function by name (e.g.
326340
set-labels). And I can find everything including doc, examples, homepage,
327-
maintainers information about the function.
341+
maintainers, publisher information about the function.
328342

329343
#### Story 2
330344

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.
333349

334350
#### Story 3
335351

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)
339362

340363
```
341364
apiVersion: kustomize.config.k8s.io/v1beta1
342365
kind: Kustomization
343366
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.
345368
resources:
346369
- input.yaml
347370
transformers:
348371
- ...
349372
```
350373

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+
351389
### Notes/Constraints/Caveats (Optional)
352390

353391
<!--
@@ -374,6 +412,12 @@ Consider including folks who also work outside the SIG or subproject.
374412
Security might be a potential risk here. We have introduced the publisher
375413
concept to mitigate the risk.
376414

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+
377421
## Design Details
378422

379423
<!--
@@ -466,7 +510,8 @@ We can mix the 2 management models above.
466510
We can manage the source code of the Kustomize provided KRM functions in-tree.
467511
Generic KRM functions like set-labels, set-annotations and set-namespace can be
468512
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.
470515

471516
The model of centralized index with distributed release is more flexible and
472517
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
476521
standardize the metadata format for KRM functions, since we will require all
477522
contributors to follow it. A website can be built using the metadata information.
478523

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+
479533
### Test Plan
480534

481535
<!--
@@ -496,8 +550,12 @@ when drafting this test plan.
496550
[testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
497551
-->
498552

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.
501559

502560
### Graduation Criteria
503561

0 commit comments

Comments
 (0)