Skip to content

Commit

Permalink
Deduplicate kpt function docs (#923)
Browse files Browse the repository at this point in the history
  • Loading branch information
prachirp authored Aug 18, 2020
1 parent 54d355f commit 8a9a358
Show file tree
Hide file tree
Showing 78 changed files with 2,418 additions and 4,492 deletions.
15 changes: 9 additions & 6 deletions docs/concepts/functions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,9 @@ <h2 id="functions-concepts">Functions Concepts</h2>
<img src="https://googlecontainertools.github.io/kpt//images/func.png" />

<ul>
<li><code>FUNC</code>: A program, packaged as a container, that performs CRUD (Create, Read,
Update, Delete) operations on the input.</li>
<li><code>FUNC</code>: A program that performs CRUD (Create, Read, Update, Delete)
operations on the input. This program can be packaged as a container,
executable, or starlark script.</li>
<li><code>input</code>: A Kubernetes List type containing objects to operate on.</li>
<li><code>output</code>: A Kubernetes List type containing the resultant Kubernetes objects.</li>
<li><code>functionConfig</code>: An optional Kubernetes object used to parameterize the
Expand All @@ -434,7 +435,6 @@ <h3 id="source-function">Source Function</h3>

<p>Instead, the function typically produces the <code>output</code> by reading configurations
from an external system (e.g. reading files from a filesystem).</p>
<p>Note: Source functions are <em>function</em>. They are invoked by command <code>kpt fn run</code> instead of <code>kpt fn source</code>.</p>
<h3 id="sink-function">Sink Function</h3>
<p>A Sink Function produces no <code>output</code>:</p>

Expand All @@ -444,14 +444,17 @@ <h3 id="sink-function">Sink Function</h3>

<p>Instead, the function typically writes configurations to an external system
(e.g. writing files to a filesystem).</p>
<p>Note: Sink functions are <em>function</em>. They are invoked by command <code>kpt fn run</code> instead of <code>kpt fn sink</code>.</p>
<h3 id="pipeline">Pipeline</h3>
<p>Functions can be composed into a pipeline:</p>
<p>In order do something useful with a function, we need to compose a pipeline
with a source and a sink function.</p>



<img src="https://googlecontainertools.github.io/kpt//images/pipeline.png" />

<p>You can also use a container-based workflow orchestrator by exporting a workflow
pipeline. Get detailed tutorials on how to use <code>kpt fn export</code> from the
<a href="../../guides/consumer/function/export/">Export a Workflow</a> guide.</p>
<h2 id="next-steps">Next Steps</h2>
<ul>
<li>Get a quickstart on writing functions from the <a href="../../guides/producer/functions/">function producer docs</a>.</li>
Expand Down Expand Up @@ -481,7 +484,7 @@ <h2 id="next-steps">Next Steps</h2>



<div class="text-muted mt-5 pt-3 border-top">Last modified July 28, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/9225091c5080ee9747042295d35b8d18f481d186">Docs: Add docker image to installation (9225091c)</a>
<div class="text-muted mt-5 pt-3 border-top">Last modified August 9, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/3e15696524cf11329219d82e7a7876e75b7aa984">Docs: Address review comments on kpt function docs (3e156965)</a>
</div>
</div>

Expand Down
11 changes: 6 additions & 5 deletions docs/faq/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,17 @@ <h4 id="q-i-really-like-dsl--templating-solution-x-can-i-use-it-with-kpt"><stron
directly, and merged when regenerated.</p>
<h4 id="q-i-want-to-write-high-level-abstractions-like-crds-but-on-the-client-side-can-i-do-this-with-kpt"><strong>Q: I want to write high-level abstractions like CRDs, but on the client-side. Can I do this with <code>kpt</code>?</strong></h4>
<p>A: Yes. <code>kpt</code>'s architecture facilitates the developing programs which may
generate or modify configuration. See the <a href="../guides/consumer/function/pipeline/">functions pipeline</a> page for how to
generate or modify configuration. See the <a href="../guides/consumer/function/">Functions User Guide</a> for how to
compose multiple programs together.</p>
<h4 id="q-how-do-i-roll-out-changes-throughout-my-organization-using-kpt"><strong>Q: How do I roll out changes throughout my organization using <code>kpt</code>?</strong></h4>
<p>A: This can be done one of several ways, including: 1) using semantic
versioning or release channels with <a href="../reference/fn/run/">functions</a>, or 2) <a href="../reference/pkg/update/">updating</a> packages.</p>
<h4 id="q-is-there-a-container-image-that-contains-kpt"><strong>Q: Is there a container image that contains kpt?</strong></h4>
<p>A: Yes. <a href="https://gcr.io/kpt-dev/kpt">gcr.io/kpt-dev/kpt</a> contains the <code>kpt</code> binary.</p>
<h4 id="q-how-to-run-sourcesink-functions-should-i-use-kpt-fn-source-and-kpt-fn-sink"><strong>Q: How to run source/sink functions? Should I use <code>kpt fn source</code> and <code>kpt fn sink</code>?</strong></h4>
<p>A: No. All source and sink functions should be run by <code>kpt fn run</code>. <code>kpt fn sink</code> and <code>kpt fn source</code> are commands which
can only specified builtin functions.</p>
<h4 id="q-how-do-i-run-source-or-sink-functions"><strong>Q: How do I run source or sink functions?</strong></h4>
<p>A: All kpt functions, including source and sink functions, should be run using
<code>kpt fn run</code>. The <code>kpt fn source</code> and <code>kpt fn sink</code> commands run builtin source
and sink functions.</p>
<h4 id="q-i-still-have-questions-how-do-i-contact-you"><strong>Q: I still have questions. How do I contact you?</strong></h4>
<p>A: <a href="../contact/">Please reach out!</a></p>
<h3 id="next-steps">Next Steps</h3>
Expand All @@ -366,7 +367,7 @@ <h3 id="next-steps">Next Steps</h3>



<div class="text-muted mt-5 pt-3 border-top">Last modified July 28, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/3a694b8a45d1c23da9e8354d83a533b3e9cbdb3e">Regenerate docs (3a694b8a)</a>
<div class="text-muted mt-5 pt-3 border-top">Last modified August 14, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/7426c4c76569c20da445705b1421d801dec019fa">Docs: Further review comments (7426c4c7)</a>
</div>
</div>

Expand Down
25 changes: 0 additions & 25 deletions docs/guides/consumer/apply/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,29 +407,6 @@



<ul class="td-sidebar-nav__section pr-md-3">
<li class="td-sidebar-nav__section-title">
<a href="/kpt/guides/consumer/function/pipeline/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Running a Functions Pipeline</a>
</li>
<ul>
<li class="collapse " id="kptguidesconsumerfunctionpipeline">



</li>
</ul>
</ul>











<ul class="td-sidebar-nav__section pr-md-3">
<li class="td-sidebar-nav__section-title">
<a href="/kpt/guides/consumer/function/export/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Exporting a Workflow</a>
Expand Down Expand Up @@ -1399,8 +1376,6 @@ <h3 id="prune-output">Prune Output</h3>








Expand Down
25 changes: 0 additions & 25 deletions docs/guides/consumer/display/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,29 +407,6 @@



<ul class="td-sidebar-nav__section pr-md-3">
<li class="td-sidebar-nav__section-title">
<a href="/kpt/guides/consumer/function/pipeline/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Running a Functions Pipeline</a>
</li>
<ul>
<li class="collapse " id="kptguidesconsumerfunctionpipeline">



</li>
</ul>
</ul>











<ul class="td-sidebar-nav__section pr-md-3">
<li class="td-sidebar-nav__section-title">
<a href="/kpt/guides/consumer/function/export/" class="align-left pl-0 pr-2 collapsed td-sidebar-link td-sidebar-link__section">Exporting a Workflow</a>
Expand Down Expand Up @@ -1349,8 +1326,6 @@ <h3 id="dump-output">Dump Output</h3>








Expand Down
14 changes: 7 additions & 7 deletions docs/guides/consumer/function/catalog/catalog/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"description": "Add an Application CR to a group of resources.",
"type": "source",
"toolchain": "../../../producer/functions/golang/",
"example": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/application-cr/"
"example": "https://github.com/kubernetes-sigs/kustomize/tree/master/functions/examples/application-cr/"
},
{
"image": "gcr.io/kpt-functions/kustomize-build",
Expand Down Expand Up @@ -88,15 +88,15 @@
"type": "validator",
"demo": true,
"toolchain": "../../../producer/functions/golang/",
"example": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/validator-kubeval/"
"example": "https://github.com/kubernetes-sigs/kustomize/tree/master/functions/examples/validator-kubeval/"
},
{
"image": "gcr.io/kustomize-functions/example-validator",
"source": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/validator-resource-requests/image/main.go",
"description": "Validates Kubernetes configuration files using schemas from the Kubernetes OpenAPI spec.",
"type": "validator",
"toolchain": "../../../producer/functions/golang/",
"example": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/validator-resource-requests/"
"example": "https://github.com/kubernetes-sigs/kustomize/tree/master/functions/examples/validator-resource-requests/"
},
{
"image": "gcr.io/kpt-functions/suggest-psp",
Expand Down Expand Up @@ -130,7 +130,7 @@
},
{
"image": "gcr.io/kubeflow-images-public/kustomize-fns/remove-namespace",
"source": "https://github.com/kubeflow/kfctl/blob/master/kustomize-fns/remove-namespace/main.go",
"source": "https://github.com/kubeflow/kfctl/tree/master/kustomize-fns/remove-namespace/",
"description": "Removes the namespace field of cluster-scoped configs.",
"type": "transformer",
"toolchain": "../../../producer/functions/golang/"
Expand All @@ -157,7 +157,7 @@
"description": "Sets cpu and memory reservations on all containers for Resources annotated with tshirt size.",
"type": "transformer",
"toolchain": "../../../producer/functions/golang/",
"example": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/injection-tshirt-sizes/"
"example": "https://github.com/kubernetes-sigs/kustomize/tree/master/functions/examples/injection-tshirt-sizes/"
},
{
"image": "gcr.io/kpt-functions/annotate-config",
Expand Down Expand Up @@ -189,14 +189,14 @@
"description": "Generate configuration from go templates using the functionConfig as the template input.",
"type": "generator",
"toolchain": "../../../producer/functions/golang/",
"example": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/template-go-nginx/"
"example": "https://github.com/kubernetes-sigs/kustomize/tree/master/functions/examples/template-go-nginx/"
},
{
"image": "gcr.io/kustomize-functions/example-cockroachdb",
"source": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/template-heredoc-cockroachdb/image/cockroachdb-template.sh",
"description": "Generate configuration from heredoc template using the functionConfig as the template input.",
"type": "generator",
"example": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/template-heredoc-cockroachdb/"
"example": "https://github.com/kubernetes-sigs/kustomize/tree/master/functions/examples/template-heredoc-cockroachdb/"
},
{
"image": "gcr.io/kpt-functions/no-op",
Expand Down
27 changes: 15 additions & 12 deletions docs/guides/consumer/function/catalog/catalog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,27 @@ description: >
DO NOT EDIT. Generated by: "cd catalog; npm run gen-docs"
-->
This repository documents a catalog of functions implementing [Configuration Functions Specification][spec].
This repository documents a catalog of functions implementing the
[Configuration Functions Specification][spec].
Run functions either imperatively or declaratively by following the [Functions User Guide].
Run functions either imperatively or declaratively by following the
[Functions User Guide].
Implement configuration functions using any toolchain such as the [Typescript SDK][ts sdk] or [Golang Libraries][go libs].
Note: Source functions and sink functions are *functions*. They are invoked by command \`kpt fn run\` instead of \`kpt fn source\` or \`kpt fn sink\`.
\`kpt fn source\` and \`kpt fn sink\` commands are running specified builtin functions.
Implement configuration functions using any toolchain such as the
[Typescript SDK][ts sdk] or [Golang Libraries][go libs].
## Sources
See [definition of source functions][source].
${tableByType('source')}
Note: Source functions are *function*. They are invoked by command \`kpt fn run\` instead of \`kpt fn source\`.
## Sinks
See [definition of sink functions][sink].
${tableByType('sink')}
Note: Sink functions are *function*. They are invoked by command \`kpt fn run\` instead of \`kpt fn sink\`.
## Validators
${tableByType('validator')}
Expand All @@ -80,11 +76,18 @@ ${tableByType('transformer')}
${tableByType('misc')}
## Next Steps
- Learn more ways of using the kpt fn command from the [reference] doc.
- Get a quickstart on writing functions from the [function producer docs].
[spec]: https://github.com/kubernetes-sigs/kustomize/blob/master/cmd/config/docs/api-conventions/functions-spec.md
[Functions User Guide]: ../
[ts sdk]: ../../../producer/functions/ts/
[go libs]: ../../../producer/functions/golang/
[source]: ../../../../concepts/functions/#source-function
[sink]: ../../../../concepts/functions/#sink-function
[ts sdk]: ../../../producer/functions/ts/
[go libs]: ../../../producer/functions/golang/`;
[reference]: ../../../../reference/fn/run/
[function producer docs]: ../../../producer/functions/`;

console.log(README);
Loading

0 comments on commit 8a9a358

Please sign in to comment.