| 1 | ## run |
| 2 | |
| 3 | [Alpha] Reconcile config functions to Resources. |
| 4 | |
| 5 | ### Synopsis |
| 6 | |
| 7 | [Alpha] Reconcile config functions to Resources. |
| 8 | |
| 9 | run sequentially invokes all config functions in the directory, providing Resources |
| 10 | in the directory as input to the first function, and writing the output of the last |
| 11 | function back to the directory. |
| 12 | |
| 13 | The ordering of functions is determined by the order they are encountered when walking the |
| 14 | directory. To clearly specify an ordering of functions, multiple functions may be |
| 15 | declared in the same file, separated by '---' (the functions will be invoked in the |
| 16 | order they appear in the file). |
| 17 | |
| 18 | #### Arguments: |
| 19 | |
| 20 | DIR: |
| 21 | Path to local directory. |
| 22 | |
| 23 | #### Config Functions: |
| 24 | |
| 25 | Config functions are specified as Kubernetes types containing a metadata.annotations.[config.kubernetes.io/function] |
| 26 | field specifying an image for the container to run. This image tells run how to invoke the container. |
| 27 | |
| 28 | Example config function: |
| 29 | |
| 30 | # in file example/fn.yaml |
| 31 | apiVersion: fn.example.com/v1beta1 |
| 32 | kind: ExampleFunctionKind |
| 33 | metadata: |
| 34 | annotations: |
| 35 | config.kubernetes.io/function: | |
| 36 | container: |
| 37 | # function is invoked as a container running this image |
| 38 | image: gcr.io/example/examplefunction:v1.0.1 |
| 39 | config.kubernetes.io/local-config: "true" # tools should ignore this |
| 40 | spec: |
| 41 | configField: configValue |
| 42 | |
| 43 | In the preceding example, 'kustomize fn run example/' would identify the function by |
| 44 | the metadata.annotations.[config.kubernetes.io/function] field. It would then write all Resources in the directory to |
| 45 | a container stdin (running the gcr.io/example/examplefunction:v1.0.1 image). It |
| 46 | would then write the container stdout back to example/, replacing the directory |
| 47 | file contents. |
| 48 | |
| 49 | See `kustomize docs-fn` for more details on writing functions. |
| 50 | |
| 51 | ### Examples |
| 52 | |
| 53 | kustomize fn run example/ |