Skip to content

Commit

Permalink
Add structured results section and link to toolchain used to make cat…
Browse files Browse the repository at this point in the history
…alog functions
  • Loading branch information
prachirp committed Jun 19, 2020
1 parent 7bf1a36 commit 4be5d83
Show file tree
Hide file tree
Showing 27 changed files with 541 additions and 237 deletions.
2 changes: 1 addition & 1 deletion docs/concepts/api-conventions/index.html
Expand Up @@ -455,7 +455,7 @@ <h2 id="next-steps">Next Steps</h2>



<div class="text-muted mt-5 pt-3 border-top">Last modified May 6, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/186760406e45268af6caa15e62624c2d78d6d259">kpt architecture docs (18676040)</a>
<div class="text-muted mt-5 pt-3 border-top">Last modified June 19, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/7bf1a36d19747d493ad7972c23b53c7070f7ae57">Transfer kpt-functions sdk and catalog docs to kpt (7bf1a36d)</a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/architecture/index.html
Expand Up @@ -567,7 +567,7 @@ <h3 id="targets">Targets</h3>



<div class="text-muted mt-5 pt-3 border-top">Last modified May 17, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/75a6f8670213bf4391b2b10221188b6348c5ba05">Minor suggestions to arch page doc (75a6f867)</a>
<div class="text-muted mt-5 pt-3 border-top">Last modified June 19, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/7bf1a36d19747d493ad7972c23b53c7070f7ae57">Transfer kpt-functions sdk and catalog docs to kpt (7bf1a36d)</a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/functions/index.html
Expand Up @@ -441,7 +441,7 @@ <h2 id="next-steps">Next Steps</h2>



<div class="text-muted mt-5 pt-3 border-top">Last modified April 22, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/66b3df8083d0e9a5db44f477077afadba63422ca">Move function docs to guides (66b3df80)</a>
<div class="text-muted mt-5 pt-3 border-top">Last modified June 19, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/7bf1a36d19747d493ad7972c23b53c7070f7ae57">Transfer kpt-functions sdk and catalog docs to kpt (7bf1a36d)</a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/packaging/index.html
Expand Up @@ -376,7 +376,7 @@ <h2 id="packaging">Packaging</h2>



<div class="text-muted mt-5 pt-3 border-top">Last modified May 6, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/186760406e45268af6caa15e62624c2d78d6d259">kpt architecture docs (18676040)</a>
<div class="text-muted mt-5 pt-3 border-top">Last modified June 19, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/7bf1a36d19747d493ad7972c23b53c7070f7ae57">Transfer kpt-functions sdk and catalog docs to kpt (7bf1a36d)</a>
</div>
</div>

Expand Down
88 changes: 56 additions & 32 deletions docs/guides/consumer/function/catalog/catalog/catalog.json
Expand Up @@ -11,7 +11,8 @@
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/ts/demo-functions/src/read_yaml.ts",
"description": "Reads a directory of Kubernetes configuration recursively.",
"type": "source",
"demo": true
"demo": true,
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/cloud-builders/kubectl",
Expand All @@ -20,29 +21,12 @@
"description": "Get one or many resources from a Kubernetes cluster.",
"type": "source"
},
{
"image": "gcr.io/kpt-functions/helm-template",
"source": "https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/functions/helm-template/run.sh",
"description": "Render chart templates locally using helm template. (See [usage](docs/helm-template/usage/index.html)).",
"type": "source"
},
{
"image": "gcr.io/kustomize-functions/create-application",
"source": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/application-cr/image/main.go",
"description": "Add an Application CR to a group of resources.",
"type": "source"
},
{
"image": "gcr.io/kustomize-functions/example-nginx",
"source": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/template-go-nginx/image/main.go",
"description": "Generate configuration from go templates using the functionConfig as the template input.",
"type": "source"
},
{
"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": "source"
"type": "source",
"toolchain": "../../../producer/functions/golang"
},
{
"image": "gcr.io/kpt-dev/kpt",
Expand All @@ -56,71 +40,111 @@
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/ts/demo-functions/src/write_yaml.ts",
"description": "Writes a directory of Kubernetes configuration. It maintains the original directory structure as read by source functions.",
"type": "sink",
"demo": true
"demo": true,
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/kpt-functions/gatekeeper-validate",
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/go/pkg/functions/gatekeeper/validate.go",
"description": "Enforces OPA constraints on input objects. The constraints are also passed as part of the input to the function.",
"type": "validator"
"type": "validator",
"toolchain": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/go/pkg/framework"
},
{
"image": "gcr.io/kpt-functions/validate-rolebinding",
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/ts/demo-functions/src/validate_rolebinding.ts",
"description": "Enforces a blacklist of subjects in RoleBinding objects.",
"type": "validator",
"demo": true
"demo": true,
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/kustomize-functions/example-validator-kubeval",
"source": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/validator-kubeval/image/main.go",
"description": "Validates that all containers have cpu and memory reservations set.",
"type": "validator"
"type": "validator",
"toolchain": "../../../producer/functions/golang"
},
{
"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"
"type": "validator",
"toolchain": "../../../producer/functions/golang"
},
{
"image": "gcr.io/kpt-functions/suggest-psp",
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/ts/demo-functions/src/suggest_psp.ts",
"description": "Lints PodSecurityPolicy by suggesting 'spec.allowPrivilegeEscalation' field be set to 'false'.",
"type": "validator",
"demo": true,
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/kpt-functions/mutate-psp",
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/ts/demo-functions/src/mutate_psp.ts",
"description": "Mutates PodSecurityPolicy objects by setting spec.allowPrivilegeEscalation to false.",
"type": "transformer",
"demo": true
"demo": true,
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/kpt-functions/label-namespace",
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/ts/hello-world/src/label_namespace.ts",
"description": "Adds a label to all Namespaces.",
"type": "transformer",
"demo": true
"demo": true,
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/kpt-functions/helm-template",
"source": "https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/functions/helm-template/run.sh",
"source": "https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/functions/ts/src/helm_template.ts",
"description": "Render chart templates locally using helm template. (See [usage](docs/helm-template/usage/index.html)).",
"type": "transformer"
"type": "transformer",
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/kustomize-functions/example-tshirt",
"source": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/injection-tshirt-sizes/image/main.go",
"description": "Sets cpu and memory reservations on all containers for Resources annotated with tshirt size.",
"type": "transformer"
"type": "transformer",
"toolchain": "../../../producer/functions/golang"
},
{
"image": "gcr.io/kpt-functions/expand-team-cr",
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/ts/demo-functions/src/expand_team_cr.ts",
"description": "Reads custom resources of type Team and generates multiple Namespace and RoleBinding objects.",
"type": "generator",
"demo": true
"demo": true,
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/kpt-functions/helm-template",
"source": "https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/functions/ts/src/helm_template.ts",
"description": "Render chart templates locally using helm template. (See [usage](docs/helm-template/usage/index.html)).",
"type": "generator",
"toolchain": "../../../producer/functions/ts"
},
{
"image": "gcr.io/kustomize-functions/example-nginx",
"source": "https://github.com/kubernetes-sigs/kustomize/blob/master/functions/examples/template-go-nginx/image/main.go",
"description": "Generate configuration from go templates using the functionConfig as the template input.",
"type": "generator",
"toolchain": "../../../producer/functions/golang"
},
{
"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",
"toolchain": "../../../producer/functions/golang"
},
{
"image": "gcr.io/kpt-functions/no-op",
"source": "https://github.com/GoogleContainerTools/kpt-functions-sdk/tree/master/ts/demo-functions/src/no_op.ts",
"description": "No Op function for testing purposes",
"type": "misc",
"demo": true
"demo": true,
"toolchain": "../../../producer/functions/ts"
}
]
13 changes: 9 additions & 4 deletions docs/guides/consumer/function/catalog/catalog/index.js
Expand Up @@ -2,14 +2,18 @@ const data = require('./catalog.json');
const table = require('markdown-table');

function tableByType(type) {
let t = [['Image', 'Args', 'Description', 'Source']];
let t = [['Image', 'Args', 'Description', 'Source', 'Toolchain']];
data.filter(r => r.type === type).forEach(r => {
let desc = r.description;
if (r.demo === true) {
desc = '[Demo] ' + desc;
}
const source = `[Link](${r.source})`;
t.push([r.image, r.args, desc, source]);
let toolchain = ``;
if (r.toolchain) {
toolchain = `[SDK](${r.toolchain})`;
}
t.push([r.image, r.args, desc, source, toolchain]);
});
return table(t);
}
Expand All @@ -29,7 +33,7 @@ DO NOT EDIT. Generated by: "cd catalog; npm run gen-docs"
This repository documents a catalog of functions implementing [Configuration Functions Specification][spec].
These functions can be implemented using any toolchain such as the [KPT Functions SDK][sdk].
These functions can be implemented using any toolchain such as the [Typescript SDK][ts sdk] or [Golang SDK][go sdk].
## Sources
Expand Down Expand Up @@ -62,6 +66,7 @@ ${tableByType('misc')}
[spec]: https://github.com/kubernetes-sigs/kustomize/blob/master/cmd/config/docs/api-conventions/functions-spec.md
[source]: ../../../../concepts/functions/#source-function
[sink]: ../../../../concepts/functions/#sink-function
[sdk]: https://github.com/GoogleContainerTools/kpt-functions-sdk/`;
[ts sdk]: ../../../producer/functions/ts
[go sdk]: ../../../producer/functions/golang`;

console.log(README);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -25,11 +25,11 @@
" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://googlecontainertools.github.io/kpt/guides/consumer/function/catalog/docs/helm-template/usage/" />
<meta property="og:site_name" content="Kpt" />
<meta property="article:modified_time" content="2020-06-19T15:07:12-04:00" /><meta property="og:site_name" content="Kpt" />
<meta itemprop="name" content="Helm-template Usage">
<meta itemprop="description" content="Helm-template Usage.
">

<meta itemprop="dateModified" content="2020-06-19T15:07:12-04:00" />
<meta itemprop="wordCount" content="408">


Expand Down Expand Up @@ -1043,7 +1043,7 @@ <h3 id="how-can-i-set-arbitrary-values-in-my-chart">How can I set arbitrary valu
</code></pre></div>


<div class="text-muted mt-5 pt-3 border-top">Last modified January 1, 0001
<div class="text-muted mt-5 pt-3 border-top">Last modified June 19, 2020: <a href="https://github.com/GoogleContainerTools/kpt/commit/7bf1a36d19747d493ad7972c23b53c7070f7ae57">Transfer kpt-functions sdk and catalog docs to kpt (7bf1a36d)</a>
</div>
</div>

Expand Down

0 comments on commit 4be5d83

Please sign in to comment.