Skip to content

Commit f9eb19a

Browse files
author
Mengqi Yu
committed
Move KRM function metadata schema to the Catalog KEP
From KEP-2985 to KEP-2906
1 parent 6f17a07 commit f9eb19a

File tree

2 files changed

+191
-191
lines changed
  • keps/sig-cli

2 files changed

+191
-191
lines changed

keps/sig-cli/2906-kustomize-function-catalog/README.md

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,197 @@ This proposal introduces extension capabilities to Kustomize that may expose use
569569

570570
## Design Details
571571

572+
<details>
573+
<summary>
574+
Full OpenAPI schema
575+
</summary>
576+
577+
```yaml
578+
swagger: "2.0"
579+
info:
580+
title: KRM Function Metadata
581+
version: v1alpha1
582+
definitions:
583+
KRMFunction:
584+
type: object
585+
description: KRMFunction is metadata of a KRM function.
586+
x-kubernetes-group-version-kind:
587+
- group: config.kubernetes.io
588+
kind: KRMFunction
589+
version: v1alpha1
590+
required:
591+
- apiVersion
592+
- kind
593+
- spec
594+
properties:
595+
apiVersion:
596+
description: apiVersion of KRMFunction. i.e. config.k8s.io/v1alpha1
597+
type: string
598+
kind:
599+
description: kind of KRMFunction. i.e. KRMFunction
600+
type: string
601+
spec:
602+
type: object
603+
description: spec contains the metadata for a KRM function.
604+
required:
605+
- group
606+
- kind
607+
- description
608+
- publisher
609+
- versions
610+
properties:
611+
group:
612+
description: group of the functionConfig
613+
type: string
614+
kind:
615+
description: kind of the functionConfig
616+
type: string
617+
versions:
618+
description: the versions of the functionConfig
619+
type: array
620+
items:
621+
type: object
622+
required:
623+
- name
624+
- schema
625+
- idempotent
626+
- runtime
627+
- configMap
628+
- usage
629+
- examples
630+
- license
631+
properties:
632+
name:
633+
description: Version of the functionConfig
634+
type: string
635+
schema:
636+
description: a URI pointing to the schema of the functionConfig
637+
type: object
638+
required:
639+
- openAPIV3Schema
640+
properties:
641+
openAPIV3Schema:
642+
description: openAPIV3Schema is the OpenAPI v3 schema to use for validation
643+
$ref: "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps"
644+
idempotent:
645+
description: If the function is idempotent.
646+
type: boolean
647+
configMap:
648+
description: If the function support a ConfigMap as functionConfig.
649+
type: boolean
650+
usage:
651+
description: |
652+
A URI pointing to a README.md that describe the details of how to
653+
use the KRM function. It should at least cover what the function
654+
does and what functionConfig does it support and it should give
655+
detailed explanation about each field in the functionConfig.
656+
type: string
657+
examples:
658+
description: |
659+
A list of URIs that point to README.md files. At least one example
660+
must be provided. Each README.md should cover an example. It
661+
should at least cover how to get input resources, how to run it
662+
and what is the expected output.
663+
type: array
664+
items:
665+
type: string
666+
license:
667+
description: The license of the KRM function.
668+
type: string
669+
maintainers:
670+
description: |
671+
The maintainers for the function. It should only be used
672+
when the maintainers are different from the ones in
673+
`spec.maintainers`. When this field is specified, it
674+
override `spec.maintainers`.
675+
type: array
676+
items:
677+
type: string
678+
runtime:
679+
description: |
680+
The runtime information about the KRM function. One and only one
681+
of container and exec must be set.
682+
type: object
683+
properties:
684+
container:
685+
description: The runtime information for container-based KRM function.
686+
type: object
687+
required:
688+
- image
689+
properties:
690+
image:
691+
description: The image name of the KRM function.
692+
type: string
693+
sha256:
694+
description: |
695+
The digest of the image that can be verified against. It
696+
is required only when the image is using semver.
697+
type: string
698+
requireNetwork:
699+
description: If network is required to run this function.
700+
type: boolean
701+
requireStorageMount:
702+
description: If storage mount is required to run this function.
703+
type: boolean
704+
exec:
705+
description: The runtime information for exec-based KRM function.
706+
type: object
707+
required:
708+
- platform
709+
properties:
710+
platforms:
711+
description: Per platform runtime information.
712+
type: array
713+
items:
714+
type: object
715+
required:
716+
- bin
717+
- os
718+
- arch
719+
- uri
720+
- sha256
721+
properties:
722+
bin:
723+
description: The binary name.
724+
type: string
725+
os:
726+
description: The target operation system to run the KRM function.
727+
type: string
728+
enum:
729+
- linux
730+
- darwin
731+
- windows
732+
arch:
733+
description: The target archtechture to run the KRM function.
734+
type: string
735+
enum:
736+
- amd64
737+
- arm64
738+
uri:
739+
description: The location to download the binary.
740+
type: string
741+
sha256:
742+
description: The degist of the binary that can be used to verify the binary.
743+
type: string
744+
home:
745+
description: A URI pointing the home page of the KRM function.
746+
type: string
747+
maintainers:
748+
description: The maintainers for the function.
749+
type: array
750+
items:
751+
type: string
752+
tags:
753+
description: |
754+
The tags (or keywords) of the function. e.g. mutator, validator,
755+
generator, prefix, GCP.
756+
type: array
757+
items:
758+
type: string
759+
paths: {}
760+
```
761+
</details>
762+
572763
The catalog kind will have a YAML representation. This representation will contain metadata about the catalog, such as name labels, as well as a collection of functions. Each function entry will contain an apiVersion and kind, along with one or more references to a function provider (such as a container), as well as an optional information, such as Open API v3 definitions. Function provider references can contain https, git, or OCI references. Additionally, a provider can declare that it requires the use of network or storage mounts, which would otherwise be prohibited. The use of these requires [additional flags](https://github.com/kubernetes-sigs/kustomize/blob/1e1b9b484a836714b57b25c2cd47dda1780610e7/api/types/pluginrestrictions.go#L51-L55) on the command line.
573764
574765
When using OCI references, either a tag or digest reference can be provided. Exec functions must include an sha256 hash for verification purposes, although this can also be done by using an OCI digest reference. When a hash verification fails, or a verification hash has not been provided, Kustomize will emit an error to inform the user.

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

Lines changed: 0 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -646,197 +646,6 @@ spec:
646646
- namespace
647647
```
648648
649-
<details>
650-
<summary>
651-
Full OpenAPI schema
652-
</summary>
653-
654-
```yaml
655-
swagger: "2.0"
656-
info:
657-
title: KRM Function Metadata
658-
version: v1alpha1
659-
definitions:
660-
KRMFunction:
661-
type: object
662-
description: KRMFunction is metadata of a KRM function.
663-
x-kubernetes-group-version-kind:
664-
- group: config.kubernetes.io
665-
kind: KRMFunction
666-
version: v1alpha1
667-
required:
668-
- apiVersion
669-
- kind
670-
- spec
671-
properties:
672-
apiVersion:
673-
description: apiVersion of KRMFunction. i.e. config.k8s.io/v1alpha1
674-
type: string
675-
kind:
676-
description: kind of KRMFunction. i.e. KRMFunction
677-
type: string
678-
spec:
679-
type: object
680-
description: spec contains the metadata for a KRM function.
681-
required:
682-
- group
683-
- kind
684-
- description
685-
- publisher
686-
- versions
687-
properties:
688-
group:
689-
description: group of the functionConfig
690-
type: string
691-
kind:
692-
description: kind of the functionConfig
693-
type: string
694-
versions:
695-
description: the versions of the functionConfig
696-
type: array
697-
items:
698-
type: object
699-
required:
700-
- name
701-
- schema
702-
- idempotent
703-
- runtime
704-
- configMap
705-
- usage
706-
- examples
707-
- license
708-
properties:
709-
name:
710-
description: Version of the functionConfig
711-
type: string
712-
schema:
713-
description: a URI pointing to the schema of the functionConfig
714-
type: object
715-
required:
716-
- openAPIV3Schema
717-
properties:
718-
openAPIV3Schema:
719-
description: openAPIV3Schema is the OpenAPI v3 schema to use for validation
720-
$ref: "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps"
721-
idempotent:
722-
description: If the function is idempotent.
723-
type: boolean
724-
configMap:
725-
description: If the function support a ConfigMap as functionConfig.
726-
type: boolean
727-
usage:
728-
description: |
729-
A URI pointing to a README.md that describe the details of how to
730-
use the KRM function. It should at least cover what the function
731-
does and what functionConfig does it support and it should give
732-
detailed explanation about each field in the functionConfig.
733-
type: string
734-
examples:
735-
description: |
736-
A list of URIs that point to README.md files. At least one example
737-
must be provided. Each README.md should cover an example. It
738-
should at least cover how to get input resources, how to run it
739-
and what is the expected output.
740-
type: array
741-
items:
742-
type: string
743-
license:
744-
description: The license of the KRM function.
745-
type: string
746-
maintainers:
747-
description: |
748-
The maintainers for the function. It should only be used
749-
when the maintainers are different from the ones in
750-
`spec.maintainers`. When this field is specified, it
751-
override `spec.maintainers`.
752-
type: array
753-
items:
754-
type: string
755-
runtime:
756-
description: |
757-
The runtime information about the KRM function. One and only one
758-
of container and exec must be set.
759-
type: object
760-
properties:
761-
container:
762-
description: The runtime information for container-based KRM function.
763-
type: object
764-
required:
765-
- image
766-
properties:
767-
image:
768-
description: The image name of the KRM function.
769-
type: string
770-
sha256:
771-
description: |
772-
The digest of the image that can be verified against. It
773-
is required only when the image is using semver.
774-
type: string
775-
requireNetwork:
776-
description: If network is required to run this function.
777-
type: boolean
778-
requireStorageMount:
779-
description: If storage mount is required to run this function.
780-
type: boolean
781-
exec:
782-
description: The runtime information for exec-based KRM function.
783-
type: object
784-
required:
785-
- platform
786-
properties:
787-
platforms:
788-
description: Per platform runtime information.
789-
type: array
790-
items:
791-
type: object
792-
required:
793-
- bin
794-
- os
795-
- arch
796-
- uri
797-
- sha256
798-
properties:
799-
bin:
800-
description: The binary name.
801-
type: string
802-
os:
803-
description: The target operation system to run the KRM function.
804-
type: string
805-
enum:
806-
- linux
807-
- darwin
808-
- windows
809-
arch:
810-
description: The target archtechture to run the KRM function.
811-
type: string
812-
enum:
813-
- amd64
814-
- arm64
815-
uri:
816-
description: The location to download the binary.
817-
type: string
818-
sha256:
819-
description: The degist of the binary that can be used to verify the binary.
820-
type: string
821-
home:
822-
description: A URI pointing the home page of the KRM function.
823-
type: string
824-
maintainers:
825-
description: The maintainers for the function.
826-
type: array
827-
items:
828-
type: string
829-
tags:
830-
description: |
831-
The tags (or keywords) of the function. e.g. mutator, validator,
832-
generator, prefix, GCP.
833-
type: array
834-
items:
835-
type: string
836-
paths: {}
837-
```
838-
</details>
839-
840649
### Publishing Workflow
841650
842651
We only support publishing container-based KRM function in the public registry.

0 commit comments

Comments
 (0)