Skip to Content
Workloads

Function

Run a Function, call it, read its status and its logs, call one Function from another, serve HTTP, and scale to zero.

This page lists the spec and status fields of Function, Revision and Invocation, each with its type, its limits and its description. The Platform page explains the concept, and the metadata of every kind is the same.

Function

apiVersion: funcd.io/v1alpha1
kind: Function
metadata:
  name: pdf-render
  namespace: default
  resourceGroup: rg1
spec:
  runtime: nodejs22
  handler: handle
  image: registry.example.com/pdf-render:1.0.0
  scaling:
    idleTimeout: 5m
apiVersionkind
funcd.io/v1alpha1Function

Function.spec

FieldType and limitsDescription
bindingsobject, Function.spec.bindingsWhat the code may use: KV tables, Bucket prefixes, SQL databases, Lakes and other Functions, each under an alias, and ConfigMaps and Secrets. A binding is the grant: a call on an alias with no binding is refused with 403. Each store, Lake, ConfigMap and Secret it names must be declared at the root, in this spec's kv, buckets, sql, lakes, configMaps or secrets, or in the App's for an App's part.
bucketsarray of Function.spec.buckets[]The Buckets the Function declares: by name it creates and owns one, and a Bucket of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.blob binds only a declared Bucket, and a prefix with no owner gets the Function as its owner. An App's part declares none and binds those that the App declares.
configMapsarray of Function.spec.configMaps[]The ConfigMaps the Function declares: by name it defines one from its data, which goes with the Function, by ref it uses an existing one. spec.bindings.config binds only a declared ConfigMap, and a defined one that the spec no longer defines is deleted once the Function is Ready again and nothing else names it. An App's part declares none.
handlerstring, matching ^[A-Za-z_][A-Za-z0-9_.]*$The name of the export that the shim calls in the code, such as handle. A Function without one, or whose code has no such export, fails with ShapeInvalid.
imagestringThe OCI reference of the code's artifact: a registry reference with a tag or a digest, or an oci-layout:// reference to a layout on the server's disk. A Function whose image is missing, or cannot be resolved or pulled, starts no worker.
imageDigeststring, a sha256 digestThe sha256 digest that funcd pulls the image by and checks it against. Unset, funcd resolves the image to its digest when it creates the Revision of a new spec and keeps that digest, so a tag that moves later changes nothing.
ingressobject, Function.spec.ingressThe Function's own address at the edge. With no host and no path, it answers by name at /function/<name>; a host or a path gives it a Route of its own in place of that address, which its IngressReady condition reports. Its path may not be /function or under it.
kvarray of Function.spec.kv[]The KVStores the Function declares: by name it creates and owns one, and a store of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.kv binds only a declared store. An App's part declares none and binds those that the App declares.
lakesarray of Function.spec.lakes[]The Lakes the Function declares: by name it creates one that goes with the Function, by ref it uses an existing one. spec.bindings.lake binds only a declared Lake, and a Lake declared by name declares nothing at its own root: it binds the Function's buckets, configMaps and secrets. An App's part declares none.
poolingobject, Function.spec.poolingWhether the Function shares a worker with other Functions; unset, it runs in workers of its own.
protocolstring, one of "", cloudevent, httpHow funcd calls the code. cloudevent, the default, passes each call to the handler as a CloudEvent. http passes each edge request to the handler, an http(app) export: only the edge and another Function's ctx.fetch over a link reach it, and it needs a node runtime and no pooling.worker.
replicasinteger, 0 to 15How many workers run while the Function is awake: at least 1 once a call wakes it, and at least scaling.minReplicas. Every call goes to the lowest listening replica, and the others are spares. With minReplicas 0, replicas above 0 also starts workers before the first call, but not after a sleep. A local volume allows at most 1.
resourcesobject, Function.spec.resourcesThe CPU and memory caps of each of the Function's workers; a field left empty takes functions.defaultResources. Only the containerd runtime enforces them, and they cannot be set with pooling.worker.
runtimestring, a DNS-1123 labelThe runtime that runs the code, such as nodejs22 or python314, or one that an Addon ships for Functions. A Function without one fails with ShapeInvalid, and one whose runtime this node cannot run fails with RuntimeUnavailable.
scalingobject, Function.spec.scalingScale to zero: with minReplicas 0, the default, and an idleTimeout, a Function with no traffic goes Idle and its workers stop until the next call wakes it.
secretsarray of Function.spec.secrets[]The Secrets of the namespace that the bindings may name, each with the keys the code reads; spec.bindings.secret names only a declared Secret. The Function waits in Pending, with SecretNotFound or SecretKeyMissing, until each one exists with every declared key. An App's part declares none and binds those that the App declares.
sqlarray of Function.spec.sql[]The SQLDatabases the Function declares: by name it creates and owns one, and a database of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.sql binds only a declared database, and a database with no owner gets the Function as its owner. An App's part declares none and binds those that the App declares.
timeoutstring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)Bounds an external invoke until its response starts: 0s to 1h; 0s or unset means invoke.defaultTimeout.
volumesarray of Function.spec.volumes[]The directories the Function's workers mount. Apply refuses a Function with one unless runtime.mode is containerd and volumes.capacity or volumes.capacityBytes is set. A Function with a volume runs solo, even with pooling.worker.

Function.spec.bindings

FieldType and limitsDescription
addonarray of Function.spec.bindings.addon[]The add-on objects whose engines the code calls, each under its alias: through ctx.addon.fetch, or with any HTTP client at FUNCD_ADDON_<ALIAS>_URL with the header X-Funcd-Addon-Token set to FUNCD_ADDON_<ALIAS>_TOKEN. Each call goes through funcd, which asks Cedar for addon::call and serves only the paths that the object's edge entry serves.
blobarray of Function.spec.bindings.blob[]The Bucket prefixes the code reaches through ctx.blob, and over S3 while the S3 gateway is on, each under its alias. The binding grants reads; only the prefix's owner and the writers that a RolesAssignment names may write. A Bucket or prefix that does not exist yet holds the Function in Pending with BucketNotFound.
configarray of string values, each a DNS-1123 labelConfigMaps whose keys each worker gets as environment variables when it starts, a later ConfigMap's value winning for a key that both hold. A key that starts with FUNCD_, or that a bound Secret holds, is left out; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of a ConfigMap's. A missing ConfigMap holds the Function Failed with ConfigResolveFailed.
jobarray of Function.spec.bindings.job[]The Jobs whose runs the code starts with ctx.job.start and reads with ctx.job.get, each under its alias. The binding grants both, and a namespace Policy that forbids job::start or job::read to the Function revokes one. A run that the code starts passes the checks of a run that a person starts, and a Job's own spec refuses this list.
kvarray of Function.spec.bindings.kv[]The KV tables the code reaches through ctx.kv, each under its alias. The binding grants reads; only the table's owner and the writers that a RolesAssignment names may write. A store or table that does not exist yet holds the Function in Pending with KVStoreNotFound.
lakearray of Function.spec.bindings.lake[]The Lakes the code queries, each under its alias. The Function waits in Pending with LakeNotReady until every bound Lake is Ready.
linksarray of Function.spec.bindings.links[]The Functions the code calls, each under its alias: through ctx.invoke one whose protocol is cloudevent, through ctx.fetch one whose protocol is http. Each target must exist in the namespace when this Function is applied, the namespace's links form no cycle, and a Function that a link targets cannot be deleted until the link goes.
secretarray of string values, each a DNS-1123 labelSecrets whose keys the code reads through ctx.secret, on each read and with no cache, a later Secret's value winning for a key that both hold. No value reaches the worker's environment. No worker starts while a bound Secret is missing, and a worker whose Function a Policy forbids to read one is not ready.
sqlarray of Function.spec.bindings.sql[]The SQLDatabases the code queries through ctx.sql, each under its alias. The binding grants reads; only the database's owner and the writers that a RolesAssignment names may write. A database that does not exist yet holds the Function in Pending with SQLDatabaseNotFound.

Function.spec.bindings.addon[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe name the handler calls the object by: ctx.addon.fetch takes it, and the worker gets FUNCD_ADDON_<ALIAS>_URL and FUNCD_ADDON_<ALIAS>_TOKEN for an HTTP SDK. Unique in the list.
objectstring, required, a DNS-1123 labelAn add-on object of the Function's namespace, declared by its App when an App holds the Function. A missing one holds the Function in Pending with AddonObjectNotFound.

Function.spec.bindings.blob[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe binding's name, unique in the list; code that reaches the prefix through ctx.blob passes it.
bucketstring, required, a DNS-1123 labelThe Bucket, in the same namespace, that holds the prefix.
prefixstring, required, a DNS-1123 labelThe prefix, by its name in the Bucket's prefixes.

Function.spec.bindings.job[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe name that the code passes to ctx.job.start and ctx.job.get. Unique in the list.
jobstring, required, a DNS-1123 labelA Job of the Function's namespace. While the Job is missing, a start on its alias answers 404, and a read still answers each run that a deleted Job left, until job.retention removes it.

Function.spec.bindings.kv[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe binding's name, unique in the list, which the code passes to ctx.kv.
storestring, required, a DNS-1123 labelThe KVStore, in the same namespace, that holds the table.
tablestring, required, a DNS-1123 labelThe table, by its name in the store's tables.

Function.spec.bindings.lake[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe binding's name, unique in the list. Each worker reads the Lake's address and its token from FUNCD_LAKE_<ALIAS>_URL and FUNCD_LAKE_<ALIAS>_TOKEN, the alias upper-cased.
lakestring, required, a DNS-1123 labelThe Lake to query, in the same namespace.
FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe link's name, unique in the list, which the code passes to ctx.invoke or ctx.fetch.
targetstring, required, a DNS-1123 labelThe Function to call, in the same namespace.
timeoutstring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)Bounds the synchronous call, a cold-start wake included: 0s to 5m; 0s or unset means the 30s link default.

Function.spec.bindings.sql[]

FieldType and limitsDescription
aliasstring, required, a DNS-1123 labelThe binding's name, unique in the list, which the code passes to ctx.sql.
databasestring, required, a DNS-1123 labelThe SQLDatabase to query, in the same namespace.

Function.spec.buckets[]

FieldType and limitsDescription
deletionstring, one of retain, deleteretain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
prefixesarray of Function.spec.buckets[].prefixes[]The Bucket's prefixes, each a key space with its own owner and cap. Prefix names are unique within the Bucket. A Function or a Lake that binds a prefix the Bucket does not list waits, with the reason BucketNotFound.
quotaobject, Function.spec.buckets[].quotaCaps on the Bucket's total size and on each object. While the Bucket has a size cap, funcd refuses to sign a presigned PUT URL for it, with 403.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.

Function.spec.buckets[].prefixes[]

FieldType and limitsDescription
namestring, required, a DNS-1123 labelThe prefix's name, unique within the Bucket. Over S3, it is the first segment of each object's key.
ownerobject, Function.spec.buckets[].prefixes[].ownerThe one Function, Lake or Job that may write the prefix, named with its kind, besides the writers that a RolesAssignment names. In a Bucket that a Function, a Lake or a Job declares by name, an omitted owner is that workload. In a Workflow's buckets, a Function owner names a step and a Lake owner a lake that the Workflow declares. The prefix that a Site serves its bundle from must have no owner, since the Site writes its builds there; the prefixes of a Site's ingress rules may have one.
quotaobject, Function.spec.buckets[].prefixes[].quotaA cap on the prefix's total size: a write into the prefix must fit both this cap and the Bucket's, and while it is set funcd refuses to sign a presigned PUT URL into the prefix, with 403. It also caps a Lake's files under the prefix, though not the Lake's catalog.

Function.spec.buckets[].prefixes[].owner

FieldType and limitsDescription
kindstring, required, one of Function, Lake, JobThe workload's kind. A Function, a Lake and a Job may share a name, so the kind says which one it is; each field names the kinds it accepts.
namestring, required, a DNS-1123 labelThe workload's name, in the object's namespace.

Function.spec.buckets[].prefixes[].quota

FieldType and limitsDescription
maxBytesinteger, at least 0The same cap as a number of bytes. Set maxSize or maxBytes, not both.
maxSizestring, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.

Function.spec.buckets[].quota

FieldType and limitsDescription
maxBytesinteger, at least 0The same cap as a number of bytes. Set maxSize or maxBytes, not both.
maxObjectBytesinteger, at least 0The largest object a write may store, in bytes. A larger write gets 413, or EntityTooLarge over S3, and while it is set funcd refuses to sign a presigned PUT URL for the Bucket, with 403. 0 sets no cap of the Bucket's own, so only funcd's upload limits apply, such as s3gateway.maxUploadBytes.
maxSizestring, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.

Function.spec.configMaps[]

FieldType and limitsDescription
datamap of string to stringKeys and their string values, for settings that are not secret. Each key is an environment variable name: ASCII letters, digits and _, not starting with a digit. Each value must be UTF-8 text with no NUL byte: a Function or a Lake that binds a ConfigMap holding another value does not start. Each worker of a Function that lists the ConfigMap in bindings.config gets each key as an environment variable when it starts, except a key that starts with FUNCD_ or that a bound Secret also holds; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of the ConfigMap's. A Lake that lists it gives its engine only the keys that the Lake's bindings.config lets through.
namestring, a DNS-1123 labelThe ConfigMap's name, at most 52 characters. It is stored as <name>-<hash of data>, and the config of each part that names it is set to that stored name.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.

Function.spec.ingress

FieldType and limitsDescription
authobject, Function.spec.ingress.authHow the edge checks callers at the resource's own address; unset, the namespace's spec.edgeDefaults.auth decides, else open. A Lake refuses it, since the Lake gateway checks each caller.
enabledbooleanTurns the resource's own address on or off. Unset, it is on unless the namespace's spec.defaultExposure is explicit; a Lake's address is on only when this is true.
hoststringThe exact host of the resource's own address. Empty is the namespace's host, <namespace>.<server.baseDomain>, or, in the default namespace, any host that no other namespace reserves.
pathstringThe edge path of the resource's own address, which begins with / and does not end with / unless it is /. Empty is / when host is set, else /function/<name>, /site/<name> or /lake/<name> by kind.

Function.spec.ingress.auth

FieldType and limitsDescription
modestring, one of "", authenticated, open, oidcHow the edge checks callers. authenticated requires a bearer token, or an X-Api-Key header, of an identity that RBAC lets get Functions in the namespace: 401 without a valid one, 403 when it may not; while server.auth.edge is off, every caller gets 401. open lets anonymous callers in. oidc signs callers in with the OIDCProvider that provider names, and passes the signed-in user to the code behind it in the X-Funcd-Principal headers. Empty takes the enclosing stance, if any, else the namespace's spec.edgeDefaults.auth.mode, else open.
providerstring, a DNS-1123 labelWith mode oidc, the OIDCProvider of the namespace that signs callers in; required with oidc and refused with another mode.
unauthenticatedstring, one of "", redirect, 401, allowWith mode oidc, what a call that is not signed in gets: redirect, the default, sends a GET or HEAD navigation to the provider with 302 and gives any other call 401; 401 gives every such call 401; allow passes every call, with no principal. Refused with another mode.

Function.spec.kv[]

FieldType and limitsDescription
deletionstring, one of retain, deleteretain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
quotaobject, Function.spec.kv[].quotaCaps on the store's total size, on each value and on each key.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.
tablesarray of Function.spec.kv[].tables[]The store's tables. A table is a key space that only its owner and the writers that a RolesAssignment names may write. Table names are unique within the store, and a store with no table has nothing a Function can write.

Function.spec.kv[].quota

FieldType and limitsDescription
maxBytesinteger, at least 0The same cap as a number of bytes. Set maxSize or maxBytes, not both.
maxKeyBytesinteger, 0 to 64000The longest key, in bytes. 0 means 1024 (1 KiB).
maxSizestring, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.
maxValueBytesinteger, 0 to 1048576The largest value a write may store, in bytes. 0 means 1048576 (1 MiB).

Function.spec.kv[].tables[]

FieldType and limitsDescription
namestring, required, a DNS-1123 labelThe table's name, unique within the store.
ownerobject, Function.spec.buckets[].prefixes[].ownerThe Function or Job that owns the table, in the store's namespace, named with its kind. The owner writes the table, and so does a principal that a RolesAssignment grants kv::write on the table, its store or its namespace, such as the KV Data Writer role. In a store that a Function or a Job declares, the owner defaults to that workload; in one that a Workflow declares, a Function owner names a step, and the Function that funcd creates for that step is the owner; in a KVStore applied on its own, a table with no owner is written only through such a grant. Every workload, the owner included, reaches the table through an entry of its spec.bindings.kv.

Function.spec.lakes[]

FieldType and limitsDescription
bindingsobject, Function.spec.lakes[].bindingsWhat the Lake's engine uses: Bucket prefixes, and the ConfigMaps and Secrets of its environment.
bucketsarray of Function.spec.lakes[].buckets[]The Buckets that a Lake applied on its own declares: by name the Lake creates the Bucket, an omitted prefix owner being the Lake, and a Bucket of that name that is not the Lake's holds it in Pending with StoreNotOwned; by ref it binds an existing one. Each Bucket that the Lake's bindings.blob names must be declared here. A lake that another resource declares sets none.
configMapsarray of Function.spec.lakes[].configMaps[]The ConfigMaps that a Lake applied on its own declares: by name the Lake defines one, and a ConfigMap of its stored name that is not the Lake's holds it in Pending with StoreNotOwned; by ref it binds an existing one. Each ConfigMap that the Lake's bindings.config names must be declared here. A lake that another resource declares sets none.
ingressobject, Function.spec.ingressExposes the Lake gateway at the edge, only when enabled is true and while the Lake is Ready. The path defaults to /lake/<name>, or / with a host. Setting auth is refused, since the Lake gateway checks each caller itself.
locationobject, Function.spec.lakes[].locationThe Bucket prefix that holds the Lake's files, one of the Lake's bindings.blob. The Lake waits in Pending, with the reason PrefixNotOwned, until the prefix's owner is this Lake. The Lake's catalog is kept outside the Bucket, under the same location, so a Lake located where another was finds that Lake's files and catalog.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.
resourcesobject, Function.spec.resourcesThe cpu and memory of the Lake's engine. An empty cpu or memory sets no limit on it, and a change replaces the running engine.
secretsarray of Function.spec.lakes[].secrets[]The Secrets that a Lake applied on its own declares, with the keys its engine reads. Each Secret that the Lake's bindings.secret names must be declared here, and the Lake waits in Pending, with SecretNotFound or SecretKeyMissing, while one is missing or lacks a key. A lake that another resource declares sets none.

Function.spec.lakes[].bindings

FieldType and limitsDescription
blobarray of Function.spec.bindings.blob[], requiredThe Bucket prefixes the engine may read, each under an alias. It writes only a prefix whose owner is this Lake, and the Lake's location must be one of them.
configarray of string values, each a DNS-1123 labelConfigMaps whose data the engine gets as environment variables. Only QUACK_TOKEN and the DUCKDB_ keys pass, DUCKDB_EXTENSION_DIRECTORY excepted, and a bound Secret's value wins over a ConfigMap's for the same key. A missing ConfigMap holds the Lake in Pending, with the reason BindingResolveFailed.
secretarray of string values, each a DNS-1123 labelSecrets whose data the engine gets as environment variables, such as its QUACK_TOKEN; the same keys pass as for config. funcd asks Cedar, as the Lake, for secret::read on each: a forbidden Secret holds the Lake in Pending, with the reason BindingResolveFailed, as does a missing one in a lake that another resource declares. A changed value replaces the engine.

Function.spec.lakes[].buckets[]

FieldType and limitsDescription
deletionstring, one of retain, deleteretain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
prefixesarray of Function.spec.buckets[].prefixes[]The Bucket's prefixes, each a key space with its own owner and cap. Prefix names are unique within the Bucket. A Function or a Lake that binds a prefix the Bucket does not list waits, with the reason BucketNotFound.
quotaobject, Function.spec.buckets[].quotaCaps on the Bucket's total size and on each object. While the Bucket has a size cap, funcd refuses to sign a presigned PUT URL for it, with 403.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.

Function.spec.lakes[].configMaps[]

FieldType and limitsDescription
datamap of string to stringKeys and their string values, for settings that are not secret. Each key is an environment variable name: ASCII letters, digits and _, not starting with a digit. Each value must be UTF-8 text with no NUL byte: a Function or a Lake that binds a ConfigMap holding another value does not start. Each worker of a Function that lists the ConfigMap in bindings.config gets each key as an environment variable when it starts, except a key that starts with FUNCD_ or that a bound Secret also holds; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of the ConfigMap's. A Lake that lists it gives its engine only the keys that the Lake's bindings.config lets through.
namestring, a DNS-1123 labelThe ConfigMap's name, at most 52 characters. It is stored as <name>-<hash of data>, and the config of each part that names it is set to that stored name.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.

Function.spec.lakes[].location

FieldType and limitsDescription
bucketstring, required, a DNS-1123 labelA Bucket of the same namespace.
prefixstring, required, a DNS-1123 labelA prefix of that Bucket.

Function.spec.lakes[].secrets[]

FieldType and limitsDescription
descriptionstringWhat the Secret is for, for the installer who provides it.
keysarray of string values, required, each matching ^[A-Za-z_][A-Za-z0-9_]*$The keys read from the Secret: its data must hold each of them.
namestring, required, a DNS-1123 labelThe name of a Secret in the namespace of the resource that declares it. funcd holds its value; the resource never writes it.

Function.spec.pooling

FieldType and limitsDescription
workerstringA worker id, a DNS-1123 label: Functions of the namespace that name it, run the same runtime, are in the same resource group and have the same bindings, owned data and grants share one worker, which status.pool names. Empty, the default, runs the Function solo. Only the process runtime pools, for node runtimes and, when the server's Python is 3.14 or later, python ones; anywhere else the Function runs solo too. A pool takes the first 16 Functions by name, and the others wait in Pending with PoolFull.

Function.spec.resources

FieldType and limitsDescription
cpustringThe CPU cap of the worker or engine it sizes, as a number of cores of at least 0.01, such as 0.5 or 2. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it.
memorystringThe memory cap of the worker or engine it sizes, such as 256Mi or 4GiB: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B, above zero. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it, and there a worker that uses more memory than the cap is killed.

Function.spec.scaling

FieldType and limitsDescription
idleTimeoutstring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)The idle time before a worker is reclaimed: 0s to 24h; 0s or unset disables reclaim.
maxReplicasinteger, 0 to 15Above 0, the most that minReplicas may be; 0, the default, sets no bound. It starts no worker: replicas and minReplicas alone decide how many run.
minReplicasinteger, 0 to 15The fewest workers the Function keeps. 0, the default, lets idleTimeout scale it to zero; above 0, it never sleeps. It may not exceed maxReplicas when that is above 0, and a local volume allows at most 1.

Function.spec.secrets[]

FieldType and limitsDescription
descriptionstringWhat the Secret is for, for the installer who provides it.
keysarray of string values, required, each matching ^[A-Za-z_][A-Za-z0-9_]*$The keys read from the Secret: its data must hold each of them.
namestring, required, a DNS-1123 labelThe name of a Secret in the namespace of the resource that declares it. funcd holds its value; the resource never writes it.

Function.spec.sql[]

FieldType and limitsDescription
deletionstring, one of retain, deleteretain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.
namestring, a DNS-1123 labelThe object's name. It takes the namespace and resource group of the resource that declares it.
ownerobject, Function.spec.buckets[].prefixes[].ownerThe one Function, Lake or Job that may write the database, in its namespace, named with its kind, besides the writers that a RolesAssignment names. In a database that a Function or a Job declares by name, it defaults to that workload, and in a Workflow's sql a Function owner names a step and a Lake owner a lake that the Workflow declares. A Lake writes no SQL, so a database a Lake owns is written by those writers only. With no owner, only those writers can write it.
quotaobject, Function.spec.buckets[].prefixes[].quotaA cap on the database's total size, the bytes of its pages in use. Once it is reached, an execute gets 507 unless each of its statements is a DELETE or a DROP. A change keeps the engine running.
refstring, a DNS-1123 labelThe name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.
resourcesobject, Function.spec.resourcesThe cpu and memory of the database's engine. An empty memory means 256Mi, and an empty cpu sets no cpu limit. A change replaces the running engine.

Function.spec.volumes[]

FieldType and limitsDescription
deletionstring, one of retain, deleteOnly for a local volume declared by name: retain, the default, keeps the volume and its files with no owner when the Function drops it or is deleted, so that a ref can take it again; delete removes them.
namestring, a DNS-1123 labelThe volume's name, unique in the list; set name or ref, not both. The code reads the directory's path from FUNCD_VOLUME_<NAME>, the name or ref upper-cased.
refstring, a DNS-1123 labelInstead of name: a retained local volume that this Function, or an earlier Function of the same name, dropped with retain, and that the Function takes over; with no such volume, it waits in Pending with VolumeNotFound. Only a local volume takes a ref; it sets no deletion and states the retained volume's own size, since apply refuses another size.
sizestring, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)The volume's size, the most its directory may hold, above zero; set size or sizeBytes, not both. Apply refuses a local volume whose size changes, or that does not fit both the capacity that volumes.capacity or volumes.capacityBytes sets and the namespace's spec.volumeBudget.
sizeBytesinteger, at least 1The same size as a number of bytes. Set size or sizeBytes, not both.
typestring, required, one of emptyDir, localemptyDir is a new empty directory for each worker, removed with it; local is one durable directory that keeps its files through a crash, a redeploy and a scale to zero. A Function with a local volume runs at most 1 replica, and while it redeploys, its old and new workers hold the volume at once.

Function.status

FieldType and limitsDescription
conditionsarray of ConditionThe conditions that explain the phase.
currentRevisionstringThe Revision of the latest spec, named after the Function and its generation. While it differs from servingRevision, its workers come up beside the serving ones.
drainingRevisionstringThe Revision that the last switch moved the calls from, while any of its workers still drain: each stops once it is idle, no sooner than runtime.handOutSettle after the switch, or at runtime.drainGrace with its calls cut. Cleared with drainingSince once none drains. A worker that an open workflow run pins is not counted and stays until the run ends. A pooled Function leaves it empty.
drainingSincestring, an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03
.965Z)
When the last switch moved the calls off drainingRevision; cleared with it.
observedGenerationintegerThe generation of the spec that funcd last acted on.
phasestring, one of Pending, Deploying, Ready, Idle, Degraded, Failed, TerminatingWhere the object is in its lifecycle.
poolstringThe pool worker the Function runs in, as <runtime>/<worker>/<access>, where access is a hash of its bindings, owned data, grants and resource group. Empty when it runs solo.
replicasintegerHow many of the serving revision's workers are ready.
servingRevisionstringThe Revision whose workers take the calls; calls move to currentRevision once its workers are ready. Empty until a first worker is ready, and again while the Function wants no worker, such as while it sleeps.

Revision

apiVersionkind
funcd.io/v1alpha1Revision

Revision.spec

FieldType and limitsDescription
functionobject, Revision.spec.functionThe Function whose spec this Revision snapshots; unset on a Job's Revision. Exactly one of function and job is set.
handlerstring, matching ^[A-Za-z_][A-Za-z0-9_.]*$The export that the Revision's workers call: the spec.handler of its Function or Job when funcd created the Revision.
imagestringThe artifact that the Revision's workers run: the spec.image of its Function or Job when funcd created the Revision.
imageDigeststring, a sha256 digestThe digest that the Revision's workers pull the image by: the spec.imageDigest of its Function or Job, or the digest that its image resolved to when funcd created the Revision. It never changes, even when a tag moves.
jobstring, a DNS-1123 labelThe Job whose spec this Revision snapshots, in the Revision's namespace; unset on a Function's Revision. A Job's Revision is named <job>-v<generation>. Exactly one of function and job is set.
numberinteger, required, at least 1The generation of the spec that this Revision snapshots.
runtimestring, a DNS-1123 labelThe runtime that the Revision's workers run: the spec.runtime of its Function or Job when funcd created the Revision.
runtimeImagestringThe image of the Addon runtime that serves the Revision, which its workers run: the image of the Addon's entry when funcd created the Revision, or, for a Revision created before its runtime served it, when a pass first found the entry while no worker of the Revision ran. It never changes after: an Addon update moves no Revision. Empty for any other runtime.

Revision.spec.function

FieldType and limitsDescription
kindstring, requiredThe kind of the object it names.
namestring, required, a DNS-1123 labelThe name of the object it names.
namespacestring, a DNS-1123 labelThe namespace of the object it names.

Revision.status

FieldType and limitsDescription
conditionsarray of ConditionThe conditions that explain the phase.
observedGenerationintegerThe generation of the spec that funcd last acted on.
phasestring, one of Pending, Deploying, Ready, Idle, Degraded, Failed, TerminatingWhere the object is in its lifecycle.

Invocation

apiVersionkind
funcd.io/v1alpha1Invocation

Invocation.status

FieldType and limitsDescription
conditionsarray of ConditionThe conditions that explain the phase.
endTimestring, an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03
.965Z)
When the call ended, after its last attempt.
errorstringWhy the call failed, on a Failed record; empty when it succeeded.
observedGenerationintegerThe generation of the spec that funcd last acted on.
phasestring, one of Pending, Deploying, Ready, Idle, Degraded, Failed, TerminatingWhere the object is in its lifecycle.
startTimestring, an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03
.965Z)
When the call started; for a Sensor's action, its first attempt.

Handler API

The methods a handler calls on its context's clients, in each language funcd ships a shim for.

ctx

The per-invocation context the shim passes to the handler.

MethodWhat it does
log(...args: unknown[]): voidWrites the arguments as one log line at level INFO, as console.log does.
invoke<I = unknown, O = unknown>(alias: string, input: I): Promise<O>Calls the function that the link named alias targets, and returns its result parsed from JSON, or null when it returns nothing. The target's event.data is input, except that an object with a top-level data or specversion key is taken as the whole CloudEvent, so event.data is only its data: send such an object inside an envelope, as { specversion: '1.0', data: { data: [1], page: 2 } }. The link's timeout, 30 seconds by default, bounds the call. Fails with the HTTP status 403 when the function declares no link named alias, 409 when the target serves HTTP, 422 when input does not match the target's contract, and the target's status when its handler fails, such as 500.
fetch(alias: string, path: string, init?: RequestInit): Promise<Response>Sends an HTTP request to the function that the link named alias targets, which serves HTTP, and returns its reply as a Response, whatever its status. path starts with "/" and may carry a query; init sets the method, the headers and the body, as for the global fetch. The request body and the reply are each at most 1 MiB, and the link's timeout, 30 seconds by default, bounds the call. Fails with the HTTP status 403 when the function declares no link named alias, and 409 when the target does not serve HTTP.
remainingMs(): number | nullThe whole milliseconds left before the call's deadline, 0 once it has passed, or null when the call has none.

Each method here that calls funcd can also fail with the status 500 and the problem type urn:funcd:problem:internal, when funcd meets an error that it did not expect; funcd logs its cause.

When funcd refuses a call, the method fails with an error that holds funcd's status and problem type. This table gives them for each method, with when each happens and what to do.

MethodStatusProblem typeWhenWhat to do
invoke403urn:funcd:problem:forbiddenThe Function's spec.bindings.links has no entry for the alias.Add the link to spec.bindings.links, or call an alias that the Function links.
invoke403urn:funcd:problem:forbiddenA Policy forbids the Function to call the link's target.Change or remove the Policy that forbids link::invoke on the target.
invoke404urn:funcd:problem:not-foundThe Function that the link targets no longer exists, as when its App deleted it before the Function that links it.Create the Function again, or link one that exists.
invoke409urn:funcd:problem:conflictThe link's target serves HTTP, which ctx.invoke does not call.Call it with ctx.fetch, which only the TypeScript shim has, or link a Function whose protocol is cloudevent.
invoke413urn:funcd:problem:payload-too-largeThe request's body is larger than the local API takes for the call.Send a smaller body.
invoke413urn:funcd:problem:payload-too-largeThe target's reply is larger than 1 MiB, the most that a call carries back.Return a smaller reply, or pass the data through a Bucket.
invoke429urn:funcd:problem:resource-exhaustedThe target already has as many calls from Functions in flight as invoke.maxNestedInFlight allows.Retry once a call to the target returns, or raise invoke.maxNestedInFlight.
invoke503urn:funcd:problem:unavailableThe target's reply broke off before its end: its worker failed during the call, or the link's timeout ended it.Retry the call, and raise the link's timeout if the target needs longer.
fetch403urn:funcd:problem:forbiddenThe Function's spec.bindings.links has no entry for the alias.Add the link to spec.bindings.links, or call an alias that the Function links.
fetch403urn:funcd:problem:forbiddenA Policy forbids the Function to call the link's target.Change or remove the Policy that forbids link::invoke on the target.
fetch404urn:funcd:problem:not-foundThe path names no alias: it is not /fetch/<alias>/<path>.Pass the alias of a link, and a path that starts with /.
fetch404urn:funcd:problem:not-foundThe Function that the link targets no longer exists, as when its App deleted it before the Function that links it.Create the Function again, or link one that exists.
fetch409urn:funcd:problem:conflictThe link's target does not serve HTTP, which ctx.fetch needs.Call it with ctx.invoke, or link a Function whose protocol is http.
fetch413urn:funcd:problem:payload-too-largeThe request's body is larger than the local API takes for the call.Send a smaller body.
fetch413urn:funcd:problem:payload-too-largeThe target's reply is larger than 1 MiB, the most that a call carries back.Return a smaller reply, or pass the data through a Bucket.
fetch429urn:funcd:problem:resource-exhaustedThe target already has as many calls from Functions in flight as invoke.maxNestedInFlight allows.Retry once a call to the target returns, or raise invoke.maxNestedInFlight.
fetch503urn:funcd:problem:unavailableThe target's reply broke off before its end: its worker failed during the call, or the link's timeout ended it.Retry the call, and raise the link's timeout if the target needs longer.

HTTP API

The table lists each described operation of these kinds, with its method and path. The operation's page in the API reference gives its parameters, its body, its authentication and every answer, with when it happens and what to do.

MethodPathOperation
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/functionsList the Functions of a namespace
POST/apis/funcd.io/v1alpha1/namespaces/{namespace}/functionsCreate a Function
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/functions/{name}Read a Function
PUT/apis/funcd.io/v1alpha1/namespaces/{namespace}/functions/{name}Replace a Function
DELETE/apis/funcd.io/v1alpha1/namespaces/{namespace}/functions/{name}Delete a Function
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/functions/{name}/logsRead the logs of a Function
DELETE/apis/funcd.io/v1alpha1/namespaces/{namespace}/volumes/{function}/{name}Delete a retained volume of a Function
POST/function/{name}Call a Function
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/revisionsList the Revisions of a namespace
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/revisions/{name}Read a Revision
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/invocationsList the Invocations of a namespace
POST/apis/funcd.io/v1alpha1/namespaces/{namespace}/invocationsCreate an Invocation
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/invocations/{name}Read an Invocation
PUT/apis/funcd.io/v1alpha1/namespaces/{namespace}/invocations/{name}Replace an Invocation
DELETE/apis/funcd.io/v1alpha1/namespaces/{namespace}/invocations/{name}Delete an Invocation

On this page