diff --git a/examples/_template/README.md b/examples/_template/README.md index 773ab04c7..cbd480760 100644 --- a/examples/_template/README.md +++ b/examples/_template/README.md @@ -1,6 +1,6 @@ # some-image-foo: Example Title -## Overview +### Overview 1. Explain what this particular example demonstrates. 2. Include a link to the function reference (help doc) on first mention of the function. @@ -9,15 +9,15 @@ 1. Explain what this function config does. Focus on explaining this particular example, not repeating the function reference. -## Function invocation +### Function invocation 4. Show exact `kpt` commands to get the example package and run the function. -## Expected result +### Expected result 5. Describe the expected outcome of running the instructions above. This needs to be specific enough so that the user is confident the function works as expected (Don't just provide the command to `cat` a file). -## Function Reference +### Function Reference -6. Provide a link to the function help doc for reference. \ No newline at end of file +6. Provide a link to the function help doc for reference. diff --git a/examples/apply-setters/simple/README.md b/examples/apply-setters/simple/README.md index b0ad5582e..23f66cef5 100644 --- a/examples/apply-setters/simple/README.md +++ b/examples/apply-setters/simple/README.md @@ -59,7 +59,7 @@ environments: # kpt-set: ${env} - stage ``` -## Function invocation +### Function invocation Get the config example and try it out by running the following commands: @@ -69,7 +69,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run simple ``` -## Expected result +### Expected result Check the value of setter `name` is set to `my-new-map`. Check the value of setter `env` is set to array value `[prod, stage]`. diff --git a/examples/contrib/analyze-istio/README.md b/examples/contrib/analyze-istio/README.md index d1559e899..d2bee6400 100644 --- a/examples/contrib/analyze-istio/README.md +++ b/examples/contrib/analyze-istio/README.md @@ -5,7 +5,7 @@ Istio configuration and outputs structured results detailing any errors found during analysis. This example invokes the `analyze-istio` function using declarative configuration. -## Function Invocation +### Function Invocation Get this example and try it out by running the following commands: @@ -14,7 +14,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run analyze-istio ``` -## Expected Results +### Expected Results This should give the following output: diff --git a/examples/contrib/inflate-helm-chart/README.md b/examples/contrib/inflate-helm-chart/README.md index 92b0f3fc2..8b108e8c2 100644 --- a/examples/contrib/inflate-helm-chart/README.md +++ b/examples/contrib/inflate-helm-chart/README.md @@ -4,7 +4,7 @@ The `inflate-helm-chart` KRM config function generates a new kpt package from a local Helm chart. This example invokes the `inflate-helm-chart` function using declarative configuration. -## Function invocation +### Function invocation Get this example and try it out by running the following commands: @@ -13,7 +13,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run --as-current-user inflate-helm-chart/local-configs --mount type=bind,src=$(pwd)/inflate-helm-chart/helloworld-chart,dst=/source ``` -## Expected result +### Expected result Checking the contents of the `local-configs` directory with `kpt cfg tree inflate-helm-chart/local-configs/` should reveal the following new yaml files: diff --git a/examples/contrib/sops/README.md b/examples/contrib/sops/README.md index 0828f14d8..7be93607f 100644 --- a/examples/contrib/sops/README.md +++ b/examples/contrib/sops/README.md @@ -24,7 +24,7 @@ or if your keys are already in `gpg`, it's possibe to run: kpt fn run --env SOPS_IMPORT_PGP="$(gpg --armor --export-secret-keys)" ``` -## Function invocation +### Function invocation Get this example and try it out by running the following commands: @@ -37,7 +37,7 @@ curl -fsSL -o sops/key.asc https://raw.githubusercontent.com/mozilla/sops/master kpt fn run --env SOPS_IMPORT_PGP="$(cat sops/key.asc)" sops/local-configs ``` -## Expected result +### Expected result Verify the updated configuration: diff --git a/examples/enforce-gatekeeper/invalid-configmap/README.md b/examples/enforce-gatekeeper/invalid-configmap/README.md index f0b0d245f..267d05829 100644 --- a/examples/enforce-gatekeeper/invalid-configmap/README.md +++ b/examples/enforce-gatekeeper/invalid-configmap/README.md @@ -1,6 +1,6 @@ -# enforce-gatekeeper: invalid configmap +# enforce-gatekeeper: Invalid Configmap -## Overview +### Overview This example demonstrates how to validate ConfigMaps using a constraint. @@ -8,7 +8,7 @@ There are 3 resources: a ConstraintTemplate, a K8sBannedConfigMapKeysV1 and a ConfigMap. The constraint disallows using `private_key` as a key in the ConfigMap. -## Function invocation +### Function invocation Get the package: @@ -30,7 +30,7 @@ Run the function: $ kpt fn run --results-dir=results . ``` -## Expected result +### Expected result You should see the following output: @@ -69,7 +69,7 @@ To pass validation, let's replace the key `private_key` in the ConfigMap in `resources.yaml` with something else e.g. `public_key`. Rerun the command. It will succeed (no output). -## Function Reference Doc +### Function Reference Doc TODO: replace the following with the link to the reference doc when our site is live. https://github.com/GoogleContainerTools/kpt-functions-catalog/blob/master/functions/go/enforce-gatekeeper/README.md diff --git a/examples/enforce-gatekeeper/warning-only/README.md b/examples/enforce-gatekeeper/warning-only/README.md index ac59a6e66..5dc91f66a 100644 --- a/examples/enforce-gatekeeper/warning-only/README.md +++ b/examples/enforce-gatekeeper/warning-only/README.md @@ -1,6 +1,6 @@ -# enforce-gatekeeper: warning only +# enforce-gatekeeper: Warning Only -## Overview +### Overview This example is very similar to the invalid configmap example. The major difference is that the violations are warnings instead of errors. @@ -8,7 +8,7 @@ difference is that the violations are warnings instead of errors. In the constraint, we use `enforcementAction: warn` instead of `enforcementAction: deny`. -## Function invocation +### Function invocation Get the package: @@ -30,7 +30,7 @@ Run the function: $ kpt fn run --results-dir=results . ``` -## Expected result +### Expected result You won't any failure. But if you look at the structured output, you can find a warning about the constraint violation. @@ -63,7 +63,7 @@ To pass validation, let's replace the key `private_key` in the ConfigMap in `resources.yaml` with something else e.g. `public_key`. Rerun the command. It will no longer have the warning. -## Function Reference Doc +### Function Reference Doc TODO: replace the following with the link to the reference doc when our site is live. https://github.com/GoogleContainerTools/kpt-functions-catalog/blob/master/functions/go/enforce-gatekeeper/README.md diff --git a/examples/ensure-name-substring/advanced/README.md b/examples/ensure-name-substring/advanced/README.md index 108782a24..758f33aa4 100644 --- a/examples/ensure-name-substring/advanced/README.md +++ b/examples/ensure-name-substring/advanced/README.md @@ -27,7 +27,7 @@ fieldSpecs: The function will not only update field `.metadata.name` but also field `.spec.name` in `MyResource`. -## Function invocation +### Function invocation Get the config example and try it out by running the following commands: @@ -37,7 +37,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run advanced ``` -## Expected result +### Expected result Check all resources have `prod-` in their names and the field `.spec.name` in `MyResource` also got updated. diff --git a/examples/ensure-name-substring/prefix/README.md b/examples/ensure-name-substring/prefix/README.md index e1ff71132..ecb053424 100644 --- a/examples/ensure-name-substring/prefix/README.md +++ b/examples/ensure-name-substring/prefix/README.md @@ -19,7 +19,7 @@ data: prepend: prod- ``` -## Function invocation +### Function invocation Get the config example and try it out by running the following commands: @@ -29,7 +29,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run prefix ``` -## Expected result +### Expected result Check all resources have `prod-` in their names: diff --git a/examples/ensure-name-substring/suffix/README.md b/examples/ensure-name-substring/suffix/README.md index 1208c6f6b..3b413ffef 100644 --- a/examples/ensure-name-substring/suffix/README.md +++ b/examples/ensure-name-substring/suffix/README.md @@ -19,7 +19,7 @@ data: append: -prod ``` -## Function invocation +### Function invocation Get the config example and try it out by running the following commands: @@ -29,7 +29,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run suffix ``` -## Expected result +### Expected result Check all resources have `-prod` in their names: diff --git a/examples/kubeval/simple/README.md b/examples/kubeval/simple/README.md index e709d5b95..29b917990 100644 --- a/examples/kubeval/simple/README.md +++ b/examples/kubeval/simple/README.md @@ -1,4 +1,4 @@ -# kubeval: simple example +# kubeval: Simple Example The `kubeval` KRM config function validates Kubernetes resources using kubeval. Learn more on the [kubeval website]. @@ -6,7 +6,7 @@ Learn more on the [kubeval website]. This example invokes the kubeval function against the builtin Kubernetes v1.19.8 schema. -## Function invocation +### Function invocation Get this example and try it out by running the following commands: @@ -16,7 +16,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run simple ``` -## Expected Results +### Expected Results This should give the following output: diff --git a/examples/search-replace/simple/README.md b/examples/search-replace/simple/README.md index df9949d41..b694b84f3 100644 --- a/examples/search-replace/simple/README.md +++ b/examples/search-replace/simple/README.md @@ -41,7 +41,7 @@ metadata: namespace: my-space ``` -## Function invocation +### Function invocation Get the config example and try it out by running the following commands: @@ -51,7 +51,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run simple ``` -## Expected result +### Expected result Check the value of deployment `the-deloyment` is changed to `my-deloyment`. diff --git a/examples/set-annotations/advanced/README.md b/examples/set-annotations/advanced/README.md index 5190517f8..8d1b211e4 100644 --- a/examples/set-annotations/advanced/README.md +++ b/examples/set-annotations/advanced/README.md @@ -25,7 +25,7 @@ CRD with group `dev.example.com`, version `v1` and kind `MyResource`. We want the annotations to be added to field `.spec.selector.annotations` as well. We specify it in field `fieldSpecs`. -## Function invocation +### Function invocation Get the example config and try it out by running the following commands: @@ -35,7 +35,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run advanced ``` -## Expected result +### Expected result Check the 2 annotations have been added to both the k8s built-in resources and the custom resources. diff --git a/examples/set-annotations/simple/README.md b/examples/set-annotations/simple/README.md index f3967aad8..3273f9427 100644 --- a/examples/set-annotations/simple/README.md +++ b/examples/set-annotations/simple/README.md @@ -16,7 +16,7 @@ data: The desired annotations are provided as key-value pairs using `data` field. -## Function invocation +### Function invocation Get the example config and try it out by running the following commands: @@ -26,7 +26,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run simple ``` -## Expected result +### Expected result Check the 2 annotations have been added. diff --git a/examples/set-labels/advanced/README.md b/examples/set-labels/advanced/README.md index e97c05b75..356fcce62 100644 --- a/examples/set-labels/advanced/README.md +++ b/examples/set-labels/advanced/README.md @@ -27,7 +27,7 @@ The desired labels is provided using `labels` field. We have a CRD with group added to field `.spec.selector.labels` as well. We specify it in field `fieldSpecs`. -## Function invocation +### Function invocation Get the example config and try it out by running the following commands: @@ -37,7 +37,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run advanced ``` -## Expected result +### Expected result Check all resources have 2 labels: `color: orange` and `fruit: apple`. diff --git a/examples/set-labels/simple/README.md b/examples/set-labels/simple/README.md index 0b8cfb2b1..7849c0c2d 100644 --- a/examples/set-labels/simple/README.md +++ b/examples/set-labels/simple/README.md @@ -18,7 +18,7 @@ data: The desired labels are provided as key-value pairs using `data` field. -## Function invocation +### Function invocation Get the example config and try it out by running the following commands: @@ -28,7 +28,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run simple ``` -## Expected result +### Expected result Check all resources have 2 labels `color: orange` and `fruit: apple`. diff --git a/examples/set-namespace/advanced/README.md b/examples/set-namespace/advanced/README.md index 48b25086c..21305dafd 100644 --- a/examples/set-namespace/advanced/README.md +++ b/examples/set-namespace/advanced/README.md @@ -24,7 +24,7 @@ with group `dev.example.com`, version `v1` and kind `MyResource`. We want the namespace to be set in field `.spec.selector.annotations` as well. We specify it in field `fieldSpecs`. -## Function invocation +### Function invocation Get the example config and try it out by running the following commands: @@ -34,7 +34,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run advanced ``` -## Expected result +### Expected result Check all resources have `.metadata.namespace` set to `example-ns`: diff --git a/examples/set-namespace/simple/README.md b/examples/set-namespace/simple/README.md index 57a0e08e9..646bb5c35 100644 --- a/examples/set-namespace/simple/README.md +++ b/examples/set-namespace/simple/README.md @@ -16,7 +16,7 @@ data: The desired namespace is provided using `.data.namespace` field. -## Function invocation +### Function invocation Get the config example and try it out by running the following commands: @@ -26,7 +26,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run simple ``` -## Expected result +### Expected result Check all resources have `metadata.namespace` set to `example-ns`: diff --git a/examples/starlark/simple/README.md b/examples/starlark/simple/README.md index 63c93674b..3d893bdca 100644 --- a/examples/starlark/simple/README.md +++ b/examples/starlark/simple/README.md @@ -1,6 +1,6 @@ # starlark: Simple Example -## Overview +### Overview In this example, we are going to demonstrate how to use the starlark function with an inline starlark script as function configuration. @@ -25,7 +25,7 @@ The starlark script is embedded in the `source` field. This script read the input KRM resources from `ctx.resource_list` and sets the `.metadata.namespace` to `prod` for all resources. -## Function invocation +### Function invocation Get the config example and try it out by running the following commands: @@ -35,7 +35,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/ex kpt fn run simple ``` -## Expected result +### Expected result Check the `.metadata.namespace` field has been set to `prod` for every resource.