Crossplane Docs · v2.3 · Functions (original) (raw)

Functions extend Crossplane with new ways to configurecomposition.

You can use different composition functions to configure what Crossplane does when someone creates or updates acomposite resource (XR).

This page is a work in progress.

Functions are packages, like Providers andConfigurations. Their APIs are similar. You install and configure them the same way as a provider.

Read the composition documentation to learn how to use functions in a composition.

Install a function

Install a Function with a CrossplaneFunction object setting thespec.package value to the location of the function package.

For example, to install thepatch and transform function,

1apiVersion: pkg.crossplane.io/v1
2kind: Function
3metadata:
4  name: crossplane-contrib-function-patch-and-transform
5spec:
6  package: xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.8.2

By default, the Function pod installs in the same namespace as Crossplane (crossplane-system).

Functions are part of thepkg.crossplane.io group.

The meta.pkg.crossplane.iogroup is for creating Function packages.

Instructions on building Functions are outside of the scope of this document. Read the Crossplane contributingFunction Development Guidefor more information.

For information on the specification of Function packages read theCrossplane Function Package specification.

1apiVersion: meta.pkg.crossplane.io/v1
2kind: Function
3metadata:
4  name: provider-aws
5spec:
6# Removed for brevity