fndocs

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Code generated by "mdtogo"; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var READMEExamples = `` /* 356-byte string literal not displayed */
View Source
var READMELong = `` /* 1930-byte string literal not displayed */
View Source
var READMEShort = `Generate, transform, or validate configuration files using containerized functions.`
View Source
var RunExamples = `
	# read the Resources from DIR, provide them to a container my-fun as input,
	# write my-fn output back to DIR
	kpt fn run DIR/ --image gcr.io/example.com/my-fn
	
	# provide the my-fn with an input ConfigMap containing ` + "`" + `data: {foo: bar}` + "`" + `
	kpt fn run DIR/ --image gcr.io/example.com/my-fn:v1.0.0 -- foo=bar
	
	# run the functions in FUNCTIONS_DIR against the Resources in DIR
	kpt fn run DIR/ --fn-path FUNCTIONS_DIR/
	
	# discover functions in DIR and run them against Resource in DIR.
	# functions may be scoped to a subset of Resources -- see ` + "`" + `kpt help fn run` + "`" + `
	kpt fn run DIR/
`
View Source
var RunLong = `
Generate, transform, or validate configuration files using locally run containerized functions.

Programs are packaged as container images which are pulled and run locally.
If the container exits with non-zero status code, run will fail and print the
container ` + "`" + `STDERR` + "`" + `.

#### Imperatively run an single function

A function may be explicitly specified using the ` + "`" + `--image` + "`" + ` flag.

__Example:__ Locally run the container image ` + "`" + `gcr.io/example.com/my-fn` + "`" + ` against
the Resources in ` + "`" + `DIR/` + "`" + `:

	kpt fn run DIR/ --image gcr.io/example.com/my-fn

If ` + "`" + `DIR/` + "`" + ` is not specified, the source will default to STDIN and sink will default
to STDOUT.

__Example:__ this is equivalent to the preceding example:

	kpt source DIR/ |
	kpt fn run --image gcr.io/example.com/my-fn |
	kpt sink DIR/

Arguments specified after ` + "`" + `--` + "`" + ` will be provided to the function as a ` + "`" + `ConfigMap` + "`" + ` input.

__Example:__ In addition to the input Resources, provide to the container image a
` + "`" + `ConfigMap` + "`" + ` containing ` + "`" + `data: {foo: bar}` + "`" + `. This is used to parameterize the behavior
of the function:

	kpt fn run DIR/ --image gcr.io/example.com/my-fn -- foo=bar

#### Declaratively run one or more functions

Functions and their input configuration may be declared in files rather than directly
on the command line.

__Example:__ This is equivalent to the preceding example:

Create a file e.g. ` + "`" + `DIR/my-function.yaml` + "`" + `:

	apiVersion: v1
	kind: ConfigMap
	metdata:
	  annotations:
	    config.kubernetes.io/function: |
	      container:
	        image: gcr.io/example.com/my-fn
	data:
	  foo: bar

Run the function:

	kpt fn run DIR/

Here, rather than specifying ` + "`" + `gcr.io/example.com/my-fn` + "`" + ` as a flag, we specify it in a
file using the ` + "`" + `config.kubernetes.io/function` + "`" + ` annotation.

##### Scoping Rules

Functions which are nested under some sub directory are scoped only to Resources under 
that same sub directory. This allows fine grain control over how functions are 
executed:

__Example:__ Function declared in ` + "`" + `stuff/my-function.yaml` + "`" + ` is scoped to Resources in 
` + "`" + `stuff/` + "`" + ` and is NOT scoped to Resources in ` + "`" + `apps/` + "`" + `:

	.
	├── stuff
	│   ├── inscope-deployment.yaml
	│   ├── stuff2
	│   │     └── inscope-deployment.yaml
	│   └── my-function.yaml # functions is scoped to stuff/...
	└── apps
	    ├── not-inscope-deployment.yaml
	    └── not-inscope-service.yaml

Alternatively, you can also place function configurations in a special directory named 
` + "`" + `functions` + "`" + `.

__Example__: This is equivalent to previous example:

	.
	├── stuff
	│   ├── inscope-deployment.yaml
	│   ├── stuff2
	│   │     └── inscope-deployment.yaml
	│   └── functions
	│         └── my-function.yaml
	└── apps
	    ├── not-inscope-deployment.yaml
	    └── not-inscope-service.yaml

Alternatively, you can also use ` + "`" + `--fn-path` + "`" + ` to explicitly provide the directory 
containing function configurations:

	kpt fn run DIR/ --fn-path FUNCTIONS_DIR/

Alternatively, scoping can be disabled using ` + "`" + `--global-scope` + "`" + ` flag.

##### Declaring Multiple Functions

You may declare multiple functions. If they are specified in the same file 
(multi-object YAML file separated by ` + "`" + `---` + "`" + `), they will
be run sequentially in the order that they are specified.

##### Custom ` + "`" + `functionConfig` + "`" + `

Functions may define their own API input types - these may be client-side equivalents 
of CRDs:

__Example__: Declare two functions in ` + "`" + `DIR/functions/my-functions.yaml` + "`" + `:

	apiVersion: v1
	kind: ConfigMap
	metdata:
	  annotations:
	    config.kubernetes.io/function: |
	      container:
	        image: gcr.io/example.com/my-fn
	data:
	  foo: bar
	---
	apiVersion: v1
	kind: MyType
	metdata:
	  annotations:
	    config.kubernetes.io/function: |
	      container:
	        image: gcr.io/example.com/other-fn
	spec:
	  field:
	    nestedField: value
`
View Source
var RunShort = `Locally execute one or more functions`
View Source
var SinkExamples = `` /* 139-byte string literal not displayed */
View Source
var SinkLong = `
Implements a Sink by reading command stdin and writing to a local directory.

    kpt fn sink [DIR]

  DIR:
    Path to local directory.  If unspecified, sink will write to stdout as if it were a single file.

` + "`" + `sink` + "`" + ` writes its input to a directory
`
View Source
var SinkShort = `Explicitly specify an output sink`
View Source
var SourceExamples = `` /* 228-byte string literal not displayed */
View Source
var SourceLong = `
Implements a Source by reading configuration and writing to command stdout.

    kpt fn source [DIR...]

  DIR:
    One or more paths to local directories.  Contents from directories will be concatenated.
    If no directories are provided, source will read from stdin as if it were a single file.

` + "`" + `source` + "`" + ` emits configuration to act as input to a function
`
View Source
var SourceShort = `Explicitly specify an input source`

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL