github.com/wmuizelaar/kpt@v0.0.0-20221018115725-bd564717b2ed/internal/docs/generated/fndocs/docs.go (about) 1 // Code generated by "mdtogo"; DO NOT EDIT. 2 package fndocs 3 4 var FnShort = `Transform and validate packages using containerized functions.` 5 var FnLong = ` 6 The ` + "`" + `fn` + "`" + ` command group contains subcommands for transforming and validating ` + "`" + `kpt` + "`" + ` packages 7 using containerized functions. 8 ` 9 10 var DocShort = `Display the documentation for a function` 11 var DocLong = ` 12 ` + "`" + `kpt fn doc` + "`" + ` invokes the function container with ` + "`" + `--help` + "`" + ` flag. 13 If the function supports ` + "`" + `--help` + "`" + `, it will print the documentation to STDOUT. 14 Otherwise, it will exit with non-zero exit code and print the error message to STDERR. 15 16 kpt fn doc --image=IMAGE 17 18 Flags: 19 20 --image, i: (required flag) 21 Container image of the function e.g. ` + "`" + `gcr.io/kpt-fn/set-namespace:v0.1` + "`" + `. 22 For convenience, if full image path is not specified, ` + "`" + `gcr.io/kpt-fn/` + "`" + ` is added as default prefix. 23 e.g. instead of passing ` + "`" + `gcr.io/kpt-fn/set-namespace:v0.1` + "`" + ` you can pass ` + "`" + `set-namespace:v0.1` + "`" + `. 24 25 Environment Variables: 26 27 KPT_FN_RUNTIME: 28 The runtime to run kpt functions. It must be one of "docker", "podman" and "nerdctl". 29 ` 30 var DocExamples = ` 31 # display the documentation for image set-namespace:v0.1.1 32 kpt fn doc -i set-namespace:v0.1.1 33 ` 34 35 var EvalShort = `Execute function on resources` 36 var EvalLong = ` 37 kpt fn eval [DIR|-] [flags] [-- fn-args] 38 39 Args: 40 41 DIR|-: 42 Path to the local directory containing resources. Defaults to the current 43 working directory. Using '-' as the directory path will cause ` + "`" + `eval` + "`" + ` to 44 read resources from ` + "`" + `stdin` + "`" + ` and write the output to ` + "`" + `stdout` + "`" + `. When resources are 45 read from ` + "`" + `stdin` + "`" + `, they must be in one of the following input formats: 46 47 1. Multi object YAML where resources are separated by ` + "`" + `---` + "`" + `. 48 49 2. KRM Function Specification wire format where resources are wrapped in an object 50 of kind ResourceList. 51 52 If the output is written to ` + "`" + `stdout` + "`" + `, resources are written in multi object YAML 53 format where resources are separated by ` + "`" + `---` + "`" + `. 54 55 fn-args: 56 function arguments to be provided as input to the function. These must be 57 provided in the ` + "`" + `key=value` + "`" + ` format and come after the separator ` + "`" + `--` + "`" + `. 58 59 Flags: 60 61 --as-current-user: 62 Use the ` + "`" + `uid` + "`" + ` and ` + "`" + `gid` + "`" + ` of the kpt process for container function execution. 63 By default, container function is executed as ` + "`" + `nobody` + "`" + ` user. You may want to use 64 this flag to run higher privilege operations such as mounting the local filesystem. 65 66 --env, e: 67 List of local environment variables to be exported to the container function. 68 By default, none of local environment variables are made available to the 69 container running the function. The value can be in ` + "`" + `key=value` + "`" + ` format or only 70 the key of an already exported environment variable. 71 72 --exec: 73 Path to the local executable binary to execute as a function. Quotes are needed 74 if the executable requires arguments. ` + "`" + `eval` + "`" + ` executes only one function, so do 75 not use ` + "`" + `--image` + "`" + ` flag with this flag. This is useful for testing function locally 76 during development. It enables faster dev iterations by avoiding the function to 77 be published as container image. 78 79 --fn-config: 80 Path to the file containing ` + "`" + `functionConfig` + "`" + ` for the function. 81 82 --image, i: 83 Container image of the function to execute e.g. ` + "`" + `gcr.io/kpt-fn/set-namespace:v0.1` + "`" + `. 84 For convenience, if full image path is not specified, ` + "`" + `gcr.io/kpt-fn/` + "`" + ` is added as default prefix. 85 e.g. instead of passing ` + "`" + `gcr.io/kpt-fn/set-namespace:v0.1` + "`" + ` you can pass ` + "`" + `set-namespace:v0.1` + "`" + `. 86 ` + "`" + `eval` + "`" + ` executes only one function, so do not use ` + "`" + `--exec` + "`" + ` flag with this flag. 87 88 --image-pull-policy: 89 If the image should be pulled before rendering the package(s). It can be set 90 to one of always, ifNotPresent, never. If unspecified, always will be the 91 default. 92 If using always, kpt will ensure the function images to run are up-to-date 93 with the remote container registry. This can be useful for tags like v1. 94 If using ifNotPresent, kpt will only pull the image when it can't find it in 95 the local cache. 96 If using never, kpt will only use images from the local cache. 97 98 --include-meta-resources, m: 99 (DEPRECATED) include-meta-resources is no longer necessary because meta 100 resources are included by default with kpt version v1.0.0-beta.15+. 101 102 --match-api-version: 103 Select resources matching the given apiVersion. 104 105 --match-kind 106 Select resources matching the given kind. 107 108 --match-name: 109 Select resources matching the given name. 110 111 --match-namespace: 112 Select resources matching the given namespace. 113 114 --mount: 115 List of storage options to enable reading from the local filesytem. By default, 116 container functions can not access the local filesystem. It accepts the same options 117 as specified on the [Docker Volumes] for ` + "`" + `docker run` + "`" + `. All volumes are mounted 118 readonly by default. Specify ` + "`" + `rw=true` + "`" + ` to mount volumes in read-write mode. 119 120 --network: 121 If enabled, container functions are allowed to access network. 122 By default it is disabled. 123 124 --output, o: 125 If specified, the output resources are written to provided location, 126 if not specified, resources are modified in-place. 127 Allowed values: stdout|unwrap|<OUT_DIR_PATH> 128 1. stdout: output resources are wrapped in ResourceList and written to stdout. 129 2. unwrap: output resources are written to stdout, in multi-object yaml format. 130 3. OUT_DIR_PATH: output resources are written to provided directory. 131 The provided directory must not already exist. 132 133 --type, t; 134 Specify the function type. Accept value ` + "`" + `mutator` + "`" + ` (default), ` + "`" + `validator` + "`" + `. 135 If used with ` + "`" + `--save` + "`" + `, this flag will save the evaluated function to the corresponding 136 Kptfile section: ` + "`" + `.pipeline.mutators` + "`" + ` if type is ` + "`" + `mutator` + "`" + `; ` + "`" + `.pipeline.validators` + "`" + ` if type 137 is ` + "`" + `validator` + "`" + `. 138 139 --results-dir: 140 Path to a directory to write structured results. Directory will be created if 141 it doesn't exist. Structured results emitted by the functions are aggregated and saved 142 to ` + "`" + `results.yaml` + "`" + ` file in the specified directory. 143 If not specified, no result files are written to the local filesystem. 144 145 --save, s: 146 Save the function image and fn-config to Kptfile. Require ` + "`" + ` + "` + "`" + `" + ` + "`" + `--image` + "`" + ` + "` + "`" + `" + ` + "`" + `. 147 148 149 Environment Variables: 150 151 KPT_FN_RUNTIME: 152 The runtime to run kpt functions. It must be one of "docker", "podman" and "nerdctl". 153 ` 154 var EvalExamples = ` 155 # execute container my-fn on the resources in DIR directory and 156 # write output back to DIR 157 $ kpt fn eval DIR -i gcr.io/example.com/my-fn 158 159 # execute container my-fn on the resources in DIR directory with 160 # ` + "`" + `functionConfig` + "`" + ` my-fn-config 161 $ kpt fn eval DIR -i gcr.io/example.com/my-fn --fn-config my-fn-config 162 163 # execute container my-fn with an input ConfigMap containing ` + "`" + `data: {foo: bar}` + "`" + ` 164 $ kpt fn eval DIR -i gcr.io/example.com/my-fn:v1.0.0 -- foo=bar 165 166 # execute container my-fn and save it to Kptfile ` + "`" + `pipeline.mutators` + "`" + ` (Default) list. 167 $ kpt fn eval DIR -s -i gcr.io/example.com/my-fn:v1.0.0 -- foo=bar 168 169 # execute container my-fn and save it to Kptfile ` + "`" + `pipeline.validators` + "`" + ` list. 170 $ kpt fn eval DIR -s -t validator -i gcr.io/example.com/my-fn:v1.0.0 -- foo=bar 171 172 # execute executable my-fn on the resources in DIR directory and 173 # write output back to DIR 174 $ kpt fn eval DIR --exec ./my-fn 175 176 # execute executable my-fn with arguments on the resources in DIR directory and 177 # write output back to DIR 178 $ kpt fn eval DIR --exec "./my-fn arg1 arg2" 179 180 # execute container my-fn on the resources in DIR directory, 181 # save structured results in /tmp/my-results dir and write output back to DIR 182 $ kpt fn eval DIR -i gcr.io/example.com/my-fn --results-dir /tmp/my-results-dir 183 184 # execute container my-fn on the resources in DIR directory with network access enabled, 185 # and write output back to DIR 186 $ kpt fn eval DIR -i gcr.io/example.com/my-fn --network 187 188 # execute container my-fn on the resource in DIR and export KUBECONFIG 189 # and foo environment variable 190 $ kpt fn eval DIR -i gcr.io/example.com/my-fn --env KUBECONFIG -e foo=bar 191 192 # execute kubeval function by mounting schema from a local directory on wordpress package 193 $ kpt fn eval -i gcr.io/kpt-fn/kubeval:v0.1 \ 194 --mount type=bind,src="/path/to/schema-dir",dst=/schema-dir \ 195 --as-current-user wordpress -- additional_schema_locations=/schema-dir 196 197 # chaining functions using the unix pipe to set namespace and set labels on 198 # wordpress package 199 $ kpt fn source wordpress \ 200 | kpt fn eval - -i gcr.io/kpt-fn/set-namespace:v0.1 -- namespace=mywordpress \ 201 | kpt fn eval - -i gcr.io/kpt-fn/set-labels:v0.1 -- label_name=color label_value=orange \ 202 | kpt fn sink wordpress 203 204 # execute container 'set-namespace' on the resources in current directory and write 205 # the output resources to another directory 206 $ kpt fn eval -i gcr.io/kpt-fn/set-namespace:v0.1 -o path/to/dir -- namespace=mywordpress 207 208 # execute container 'set-namespace' on the resources in current directory and write 209 # the output resources to stdout which are piped to 'kubectl apply' 210 $ kpt fn eval -i gcr.io/kpt-fn/set-namespace:v0.1 -o unwrap -- namespace=mywordpress \ 211 | kubectl apply -f - 212 213 # execute container 'set-namespace' on the resources in current directory and write 214 # the wrapped output resources to stdout which are passed to 'set-annotations' function 215 # and the output resources after setting namespace and annotation is written to another directory 216 $ kpt fn eval -i gcr.io/kpt-fn/set-namespace:v0.1 -o stdout -- namespace=staging \ 217 | kpt fn eval - -i gcr.io/kpt-fn/set-annotations:v0.1.3 -o path/to/dir -- foo=bar 218 219 # execute container 'set-namespace' on the resources with 'name' foo and 'kind' Deployment 220 # in current directory 221 kpt fn eval -i set-namespace:v0.1 --by-kind Deployment --by-name foo -- namespace=staging 222 223 # execute container my-fn with podman on the resources in DIR directory and 224 # write output back to DIR 225 $ KPT_FN_RUNTIME=podman kpt fn eval DIR -i gcr.io/example.com/my-fn 226 ` 227 228 var ExportShort = `Auto-generating function pipelines for different workflow orchestrators` 229 var ExportLong = ` 230 kpt fn export DIR/ [--fn-path FUNCTIONS_DIR/] --workflow ORCHESTRATOR [--output OUTPUT_FILENAME] 231 232 DIR: 233 Path to a package directory. 234 FUNCTIONS_DIR: 235 Read functions from the directory instead of the DIR/. 236 ORCHESTRATOR: 237 Supported orchestrators are: 238 - github-actions 239 - cloud-build 240 - gitlab-ci 241 - jenkins 242 - tekton 243 - circleci 244 OUTPUT_FILENAME: 245 Specifies the filename of the generated pipeline. If omitted, the default 246 output is stdout 247 ` 248 var ExportExamples = ` 249 250 # read functions from DIR, run them against it as one step. 251 # write the generated GitHub Actions pipeline to main.yaml. 252 kpt fn export DIR/ --output main.yaml --workflow github-actions 253 254 255 # discover functions in FUNCTIONS_DIR and run them against resource in DIR. 256 # write the generated Cloud Build pipeline to stdout. 257 kpt fn export DIR/ --fn-path FUNCTIONS_DIR/ --workflow cloud-build 258 ` 259 260 var RenderShort = `Render a package.` 261 var RenderLong = ` 262 kpt fn render [PKG_PATH] [flags] 263 264 Args: 265 266 PKG_PATH: 267 Local package path to render. Directory must exist and contain a Kptfile 268 to be updated. Defaults to the current working directory. 269 270 Flags: 271 272 --allow-exec: 273 Allow executable binaries to run as function. Note that executable binaries 274 can perform privileged operations on your system, so ensure that binaries 275 referred in the pipeline are trusted and safe to execute. 276 277 --image-pull-policy: 278 If the image should be pulled before rendering the package(s). It can be set 279 to one of always, ifNotPresent, never. If unspecified, always will be the 280 default. 281 282 --output, o: 283 If specified, the output resources are written to provided location, 284 if not specified, resources are modified in-place. 285 Allowed values: stdout|unwrap|<OUT_DIR_PATH> 286 1. stdout: output resources are wrapped in ResourceList and written to stdout. 287 2. unwrap: output resources are written to stdout, in multi-object yaml format. 288 3. OUT_DIR_PATH: output resources are written to provided directory. 289 The provided directory must not already exist. 290 291 --results-dir: 292 Path to a directory to write structured results. Directory will be created if 293 it doesn't exist. Structured results emitted by the functions are aggregated and saved 294 to ` + "`" + `results.yaml` + "`" + ` file in the specified directory. 295 If not specified, no result files are written to the local filesystem. 296 297 Environment Variables: 298 299 KPT_FN_RUNTIME: 300 The runtime to run kpt functions. It must be one of "docker", "podman" and "nerdctl". 301 ` 302 var RenderExamples = ` 303 # Render the package in current directory 304 $ kpt fn render 305 306 # Render the package in current directory and save results in my-results-dir 307 $ kpt fn render --results-dir my-results-dir 308 309 # Render my-package-dir 310 $ kpt fn render my-package-dir 311 312 # Render the package in current directory and write output resources to another DIR 313 $ kpt fn render -o path/to/dir 314 315 # Render resources in current directory and write unwrapped resources to stdout 316 # which can be piped to kubectl apply 317 $ kpt fn render -o unwrap | kubectl apply -f - 318 319 # Render resources in current directory, write the wrapped resources 320 # to stdout which are piped to 'set-annotations' function, 321 # the transformed resources are written to another directory 322 $ kpt fn render -o stdout \ 323 | kpt fn eval - -i gcr.io/kpt-fn/set-annotations:v0.1.3 -o path/to/dir -- foo=bar 324 325 # Render my-package-dir with podman as runtime for functions 326 $ KPT_FN_RUNTIME=podman kpt fn render my-package-dir 327 ` 328 329 var SinkShort = `Write resources to a local directory` 330 var SinkLong = ` 331 kpt fn sink DIR [flags] 332 333 DIR: 334 Path to a local directory to write resources to. The directory must not already exist. 335 ` 336 var SinkExamples = ` 337 # read resources from DIR directory, execute my-fn on them and write the 338 # output to DIR directory. 339 $ kpt fn source DIR | 340 kpt fn eval - --image gcr.io/example.com/my-fn | 341 kpt fn sink NEW_DIR 342 ` 343 344 var SourceShort = `Source resources from a local directory` 345 var SourceLong = ` 346 kpt fn source [DIR] [flags] 347 348 Args: 349 350 DIR: 351 Path to the local directory containing resources. Defaults to the current 352 working directory. 353 354 Flags: 355 356 --fn-config: 357 Path to the file containing ` + "`" + `functionConfig` + "`" + `. 358 359 --include-meta-resources: 360 (DEPRECATED) include-meta-resources is no longer necessary because meta 361 resources are included by default with kpt version v1.0.0-beta.15+. 362 363 --output, o: 364 If specified, the output resources are written to stdout in provided format. 365 Allowed values: 366 1. stdout(default): output resources are wrapped in ResourceList and written to stdout. 367 2. unwrap: output resources are written to stdout, in multi-object yaml format. 368 ` 369 var SourceExamples = ` 370 # read resources from DIR directory and write the output on stdout. 371 $ kpt fn source DIR 372 373 # read resources from DIR directory, execute my-fn on them and write the 374 # output to DIR directory. 375 $ kpt fn source DIR | 376 kpt fn eval - --image gcr.io/example.com/my-fn - | 377 kpt fn sink DIR 378 `