-
Notifications
You must be signed in to change notification settings - Fork 6
flesh out READMEs and contributing docs #6
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,11 +6,49 @@ _As contributors and maintainers of this project, and in the interest of fosteri | |
|
|
||
| ## Getting Started | ||
|
|
||
| We have full documentation on how to get started contributing here: | ||
| ### Repo layout | ||
|
|
||
| ``` | ||
| ├── publishers # Home for all functions metadata | ||
| │ ├── kustomize | ||
| │ │ ├── functions | ||
| │ │ │ ├── fn-foo.yaml | ||
| │ │ │ ├── fn-bar.yaml | ||
| │ │ │ └── README.md | ||
| │ │ ├── catalogs | ||
| │ │ │ ├── v20220225.yaml | ||
| │ │ │ ├── v20220101.yaml | ||
| │ │ │ └── README.md | ||
| │ │ └── OWNERS # OWNERS of the publisher | ||
| │ ├── kubeflow | ||
| │ ├── sig-cli | ||
| │ └── OWNERS # OWNERS to approve new publishers | ||
| ├── krm-functions # Home for in-tree functions source code | ||
| │ ├── Makefile | ||
| │ ├── kustomize | ||
| │ │ ├── fn-foo | ||
| │ │ ├── README.md | ||
| │ │ └── OWNERS # OWNERS to approve code change to the function | ||
| │ └── sig-cli | ||
| ├── site | ||
| ├── Makefile | ||
| └── OWNERS | ||
| ``` | ||
|
|
||
| ## Contributing in-tree KRM function source code | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should talk about the criteria to accept functions as in-tree functions. For example, we should not accept 3rd party functions as in-tree functions, since if they give up the maintenance, it will be a problem for us. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do we consider 3rd party functions? If some company wishes to donate a function, does it need to be under SIG-CLI? In that case, would there be any publishers in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a requirements section to |
||
|
|
||
| To contribute KRM function source code, so that it can be managed and released by this repo, follow the instructions | ||
| in the [krm-functions directory]((https://github.com/kubernetes-sigs/krm-functions-registry/tree/main/krm-functions)) | ||
|
|
||
|
|
||
| ## Publishing KRM function metadata in-tree and out-of-tree functions | ||
|
|
||
| <!--- | ||
| If your repo has certain guidelines for contribution, put them here ahead of the general k8s resources | ||
| --> | ||
| To publish KRM function metadata, independently of where the source code lives, follow the instructions | ||
| in the [publishers directory](https://github.com/kubernetes-sigs/krm-functions-registry/tree/main/publishers). | ||
|
|
||
| ## General Kubernetes Contributing docs | ||
|
|
||
| We have full documentation on how to get started contributing here: | ||
|
|
||
| - [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests | ||
| - [Kubernetes Contributor Guide](https://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](https://git.k8s.io/community/contributors/guide#contributing) | ||
|
|
@@ -20,16 +58,7 @@ If your repo has certain guidelines for contribution, put them here ahead of the | |
|
|
||
| - [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers! | ||
|
|
||
| <!--- | ||
| Custom Information - if you're copying this template for the first time you can add custom content here, for example: | ||
| [Catalog KEP]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/2906-kustomize-function-catalog#function-metadata-schema | ||
|
|
||
| ## Contact Information | ||
|
|
||
| - [Slack channel](https://kubernetes.slack.com/messages/kubernetes-users) - Replace `kubernetes-users` with your slack channel string, this will send users directly to your channel. | ||
| - [Mailing list](URL) | ||
|
|
||
| --> | ||
|
|
||
| <!--- | ||
| TODO: Add a user guide doc for how to contribute in-tree and out-of-tree functions. | ||
| --> | ||
| - [Slack channel](https://kubernetes.slack.com/messages/sig-cli-krm-functions) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ | |
|
|
||
| approvers: | ||
| - krm-functions-registry-owners | ||
| - krm-functions-registry-maintainers | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Release Process \[TODO\] | ||
|
|
||
| This doc will cover the release process for the in-tree KRM | ||
| functions whose source code is stored here. | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # KRM Functions | ||
|
|
||
| This directory is the home for the source code for all in-tree functions that are maintained and | ||
| released by this repository. | ||
|
|
||
| ## Requirements | ||
|
|
||
| By donating a function's source code to this repo, you are donating the function to SIG-CLI. We cannot | ||
| accept 3rd party functions as in-tree functions. | ||
|
|
||
| ## Files | ||
|
|
||
| Each publisher will need to create their own subdirectory `krm-functions/{PUBLISHER}/` | ||
| in this directory to store their functions source code, under . For example, SIG-CLI sponsored functions are located | ||
| under `krm-functions/sig-cli/`. | ||
|
|
||
| Each function must be in its own subdirectory `krm-functions/{PUBLISHER}/{FUNCTION NAME}/`. This directory should | ||
| contain: | ||
| - An OWNERS file to approve code changes to the function. | ||
| - A README.md file to provide a user guide for the function. | ||
| - Source code and unit tests. | ||
| - A Dockerfile that describes how to build the function image. | ||
| - An `examples/` directory. An `examples/` directory. Examples that will serve both as examples for functions and as e2e tests. Each example should have its | ||
| own subdirectory `krm-functions/{PUBLISHER}/{FUNCTION NAME}/examples/{EXAMPLE_NAME}/`, and this directory should contain: | ||
| - A README.md file that serves as a guide for the example. | ||
| - A subdirectory `.expected`. This should contain two files: | ||
| - `exec.sh`: A script that will run your example. This script will be run on the example directory it is in. This can | ||
| be something as simple as `kustomize build --enable-alpha-plugins > resources.yaml`. | ||
| - `diff.patch`: This file should contain the expected diff between the original example directory files and the files | ||
| after `exec.sh` is run. | ||
| - Any additional files needed for your examples to run. For example, if you are running `kustomize build` in your `exec.sh` | ||
| script, you will need a kustomization file. | ||
|
|
||
| An example of this is SIG-CLI's [render-helm-chart](https://github.com/kubernetes-sigs/krm-functions-registry/tree/main/krm-functions/sig-cli/render-helm-chart) | ||
| function. |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,86 @@ | ||
| # render-helm-chart: Kustomize Inline Values | ||
|
|
||
| <!--- | ||
| TODO: Write up a doc for this example. | ||
| --> | ||
| ### Overview | ||
|
|
||
| This example demonstrates how to declaratively invoke the `render-helm-chart` | ||
| function with kustomize using the `valuesInline` field. | ||
|
|
||
| ### Function invocation | ||
|
|
||
| To use the function with kustomize, you can specify the `functionConfig` | ||
| in your kustomization's `generators` field. This example uses inline values | ||
| to use instead of the default values accompanying the chart: | ||
|
|
||
| kustomization.yaml: | ||
| ```yaml | ||
| generators: | ||
| - |- | ||
| apiVersion: v1alpha1 | ||
| kind: RenderHelmChart | ||
| metadata: | ||
| name: demo | ||
| annotations: | ||
| config.kubernetes.io/function: | | ||
| container: | ||
| network: true | ||
| image: us.gcr.io/k8s-artifacts-prod/krm-functions/render-helm-chart:unstable | ||
| helmCharts: | ||
| - chartArgs: | ||
| name: ocp-pipeline | ||
| version: 0.1.16 | ||
| repo: https://bcgov.github.io/helm-charts | ||
| templateOptions: | ||
| releaseName: moria | ||
| namespace: mynamespace | ||
| values: | ||
| valuesInline: | ||
| releaseNamespace: "" | ||
| rbac: | ||
| create: true | ||
| rules: | ||
| - apiGroups: [""] | ||
| verbs: ["*"] | ||
| resources: ["*"] | ||
| ``` | ||
|
|
||
| Then, to build the kustomization with kustomize v4: | ||
|
|
||
| ```shell | ||
| kustomize build --enable-alpha-plugins --network . | ||
| ``` | ||
|
|
||
| ### Expected result | ||
|
|
||
| You should also be able to find the line `def releaseNamespace = ""` somewhere | ||
| in your output, as well as the following: | ||
|
|
||
| ```yaml | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: moria-ocp-pipeline | ||
| namespace: mynamespace | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - '*' | ||
| verbs: | ||
| - '*' | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: moria-ocp-pipeline | ||
| namespace: mynamespace | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: moria-ocp-pipeline | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: jenkins | ||
| namespace: mynamespace | ||
| ``` | ||
|
|
||
| which demonstrates that the correct values provided via `valuesInline` were used. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,81 @@ | ||
| # render-helm-chart: Kustomize Values Files | ||
|
|
||
| <!--- | ||
| TODO: Write up a doc for this example. | ||
| --> | ||
| ### Overview | ||
|
|
||
| This example demonstrates how to declaratively invoke the `render-helm-chart` | ||
| function with kustomize using multiple values files. | ||
|
|
||
| ### Function invocation | ||
|
|
||
| To use the function with kustomize, you can specify the `functionConfig` | ||
| in your kustomization's `generators` field. This example specifies multiple remote | ||
| values files to use instead of the default values accompanying the chart: | ||
|
|
||
| kustomization.yaml: | ||
| ```yaml | ||
| generators: | ||
| - |- | ||
| apiVersion: v1alpha1 | ||
| kind: RenderHelmChart | ||
| metadata: | ||
| name: demo | ||
| annotations: | ||
| config.kubernetes.io/function: | | ||
| container: | ||
| network: true | ||
| image: us.gcr.io/k8s-artifacts-prod/krm-functions/render-helm-chart:unstable | ||
| helmCharts: | ||
| - chartArgs: | ||
| name: ocp-pipeline | ||
| version: 0.1.16 | ||
| repo: https://bcgov.github.io/helm-charts | ||
| templateOptions: | ||
| namespace: mynamespace | ||
| releaseName: moria | ||
| values: | ||
| valuesFiles: | ||
| - https://raw.githubusercontent.com/natasha41575/kpt-functions-catalog/a9c9cd765a05f7a7fb6923dbde4651b62c9c229c/examples/render-helm-chart-kustomize-values-files/file1.yaml | ||
| - https://raw.githubusercontent.com/natasha41575/kpt-functions-catalog/a9c9cd765a05f7a7fb6923dbde4651b62c9c229c/examples/render-helm-chart-kustomize-values-files/file2.yaml | ||
| ``` | ||
|
|
||
| Then, to build the kustomization with kustomize v4: | ||
|
|
||
| ```shell | ||
| kustomize build --enable-alpha-plugins --network . | ||
| ``` | ||
|
|
||
| ### Expected result | ||
|
|
||
| You should also be able to find the line `def releaseNamespace = ""` somewhere | ||
| in your output, as well as the following: | ||
|
|
||
| ```yaml | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: moria-ocp-pipeline | ||
| namespace: mynamespace | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - '*' | ||
| verbs: | ||
| - '*' | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: moria-ocp-pipeline | ||
| namespace: mynamespace | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: moria-ocp-pipeline | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: jenkins | ||
| namespace: mynamespace | ||
| ``` | ||
|
|
||
| which demonstrates that the correct values provided via `valuesFiles` were used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest the following layout to help publishing catalogs.
@KnVerey WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah we didn't address where the static catalogs would go in the KEP, but it makes sense for them to be subjected to the same owners files as the functions themselves, so that layout looks good. I'd stick to a single README at the
publishers/kustomizelevel though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!