# Running Configuration Functions using kustomize CLI Configuration functions can be implemented using any toolchain and invoked using any container workflow orchestrator including Tekton, Cloud Build, or run directly using `docker run`. Run `config help docs-fn-spec` to see the Configuration Functions Specification. `kustomize fn run` is an example orchestrator for invoking Configuration Functions. This document describes how to implement and invoke an example function. ## Example Function Implementation Following is an example for implementing an nginx abstraction using a configuration function. ### `nginx-template.sh` `nginx-template.sh` is a simple bash script which uses a _heredoc_ as a templating solution for generating Resources from the functionConfig input fields. The script wraps itself using `config run wrap -- $0` which will: 1. Parse the `ResourceList.functionConfig` (provided to the container stdin) into env vars 2. Merge the stdout into the original list of Resources 3. Defaults filenames for newly generated Resources (if they are not set as annotations) to `config/NAME_KIND.yaml` 4. Format the output ```bash #!/bin/bash # script must run wrapped by "kustomize fn run wrap" # for parsing input the functionConfig into env vars if [ -z ${WRAPPED} ]; then export WRAPPED=true config run wrap -- $0 exit $? fi cat <