Skip to Content
Services

Add-ons

Register an add-on built outside funcd, such as rauthy, declare its objects, run Functions and Jobs on the runtimes it ships, call their engines from a Function, apply their settings, reconcile an engineless kind's objects, back them up and sign users in through them.

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

Addon

apiVersion: funcd.io/v1alpha1
kind: Addon
metadata:
  name: rauthy
spec:
  runtimes:
    - name: rauthy
      image: ghcr.io/pyvvo/funcd-rauthy@sha256:7686fef5edcb27399e23f8386fecb03b13f909966d2c3c4708095e2c31ccfe2d
      workloads:
        - Engine
      attributes:
        kind: IdentityProvider
        port: 8080
        basePath: /auth/v1
        privatePaths:
          - /auth/v1/clients_dyn
        readiness:
          path: /auth/v1/ping
        storage:
          path: /app/data
          uid: 10001
          gid: 10001
        config:
          type: object
          additionalProperties: false
          properties:
            publicHost:
              type: string
            https:
              type: boolean
          required:
            - publicHost
            - https
        env:
          PUB_URL: ${{ config.publicHost }}
          PROXY_MODE: '${{ config.https ? "true" : "false" }}'
        secretKeys:
          - ENC_KEYS
          - ENC_KEY_ACTIVE
        snapshot:
          path: /app/data/state_machine/backups
        restore:
          path: /app/data/restore
          env:
            HQL_BACKUP_RESTORE: ${{ "file:" + restore.file }}
        settings:
          - kind: RauthyPasswordPolicy
            target: spec.config.provider
            resync: 10m
            function:
              image: ghcr.io/example/rauthy-settings@sha256:b8390e254d5f99832bdcfa0567d144725d1d96907c9da01dc5917f71c3989cba
            constraints:
              count:
                perTarget: 1
              immutable:
                - spec.config.provider
apiVersionkind
funcd.io/v1alpha1Addon

Addon.spec

FieldType and limitsDescription
runtimesarray of Addon.spec.runtimes[], requiredThe runtimes that the add-on ships, each an image and the workloads it serves. At most one entry runs the add-on's kind; an Addon whose entries run none adds no kind, and may gain one once.

Addon.spec.runtimes[]

FieldType and limitsDescription
attributesobject, Addon.spec.runtimes[].attributesThe entry's fields for its workloads: an Engine entry's kind, config, settings and engine fields; an Engineless entry's kind, config, function and resync. A Function or Job entry takes none.
imagestring, matching ^[^:@\s]+(:[0-9]+/[^:@\s]+)?@sha256:[a-f0-9]{64}$The image, pinned by digest as <repository>@sha256:<64 hex digits>, from a registry that addons.registries lists, and pulled as an engine's. A registry taken out of that list stops no worker or engine, and refuses the Addon's next change.
namestring, required, a DNS-1123 labelThe runtime's name, which a Function's or a Job's spec.runtime names: a DNS label that is none of funcd's runtimes (nodejs22, python314, duckdb, rqlite), does not start with node or python, is no key of runtime.containerd.imageOverride, and that no other Addon ships.
workloadsarray of string values, required, each one of Function, Job, Engine, EnginelessWhat the entry serves: Function and Job, which Functions and Jobs may name in spec.runtime; Engine, alone, which runs one engine of the image per object of the entry's kind; or Engineless, alone, whose kind's objects run no engine and no image: a Function of their namespace reconciles them.

Addon.spec.runtimes[].attributes

FieldType and limitsDescription
basePathstringThe path under which the edge serves an object's engine, which the engine gets as it was called. It begins with /, does not end with / unless it is /, and holds no empty, . or .. segment. Empty is /.
configany JSON valueAn Engine entry's JSON Schema of the objects' spec.config, within funcd's contract profile: closed objects, and no $ref. funcd refuses an object whose config breaks it; an object stored before a change that its config breaks waits in Pending with ConfigInvalid, with no engine. An Engineless entry sets none: its Function's contract describes its objects.
envmap of string to stringThe engine's environment. Each value is a literal, or a single ${{ }} expression over config, such as ${{ config.issuer }}, which funcd checks against the config schema when the Addon is applied. A value that is not a string reaches the engine as its JSON; one that fails holds the object in Pending with EnvInvalid.
functionobject, Addon.spec.runtimes[].attributes.functionAn Engineless entry's Function, which reconciles the objects of its kind and which funcd calls with their list: an image, from which funcd creates one Function for each object, or an existing Function of each object's namespace. An object may name its own in spec.functions.
kindstring, matching ^[A-Z][A-Za-z0-9]{1,62}$The namespaced kind that the entry runs: an upper-case letter, then 1 to 62 letters or digits. Its objects are served at /apis/funcd.io/v1alpha1/namespaces/<namespace>/<plural>, where the plural is the kind in lower case with an s. funcd refuses a kind that is its own, or whose plural is a path funcd serves or another Addon's plural, whatever the case. An Addon gains its kind once: it cannot change or go.
portinteger, 1 to 65535The port that the engine serves on, in its own network namespace; an Engine entry requires it. Only funcd reaches it.
privatePathsarray of string valuesPaths under basePath that the edge answers with 404, however a caller spells them; funcd reaches them at the engine's own address. Each has basePath's form and lies under it.
readinessobject, Addon.spec.runtimes[].attributes.readinessHow funcd learns that an object's engine is ready; an Engine entry requires it.
restoreobject, Addon.spec.runtimes[].attributes.restoreHow the engine loads a copy at its start, which an in-place Restore of an object puts in place. Unset, an object of the add-on cannot be restored.
resyncstring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)How often funcd sends an Engineless kind's lists again with no change, from 1s to 24h; unset is 10m.
secretKeysarray of string valuesThe keys of an object's bound Secrets that reach the engine's environment. A bound Secret's other keys do not.
settingsarray of Addon.spec.runtimes[].attributes.settings[]Kinds of settings objects that the add-on adds beside kind. An object of one runs no engine: the kind's Function applies the objects of each target through the target's engine.
snapshotobject, Addon.spec.runtimes[].attributes.snapshotWhere the engine writes its own consistent copies, which a Backup of an object copies. Unset, a Backup that names an object of the add-on fails with reason NoSnapshot, and a resourceGroup scope leaves the add-on's objects out.
storageobject, Addon.spec.runtimes[].attributes.storageA directory that outlives each object's engine, kept across a replaced engine and funcd's restarts. Unset, the engine keeps nothing.

Addon.spec.runtimes[].attributes.function

FieldType and limitsDescription
imagestringA Function's artifact, pinned by digest, from a registry that addons.registries lists. funcd creates the Function from it and puts back what differs: it runs the export handle, has no address of its own, and binds the object that runs an engine, the object's Secrets and an engineless object's Jobs. The artifact's contract describes the objects, and funcd refuses one whose config breaks it. Set either image or ref.
refstring, a DNS-1123 labelThe name of an existing Function in the object's namespace. funcd does not create or change it, and the objects wait while it is missing. Their config has no schema, and the kind takes no rules. Set either image or ref.

Addon.spec.runtimes[].attributes.readiness

FieldType and limitsDescription
pathstring, requiredThe path that funcd sends GET to on the engine's port. The object turns Ready once it answers 200.

Addon.spec.runtimes[].attributes.restore

FieldType and limitsDescription
envmap of string to stringThe environment of the start that loads the copy, laid over env. Each value is a literal, or a single ${{ }} expression over config and restore, such as ${{ "file:" + restore.file }}: restore.file is the copy's path in the engine.
pathstring, requiredThe folder in the engine where funcd puts the copy that the next start loads: under storage.path, and neither snapshot.path nor inside it. funcd empties it before it writes the copy, and removes the copy once the engine that loaded it is Ready.
timeoutstring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)How long an in-place Restore waits for the engine to load the copy and start again without restore.env, from 1s to 1h; unset is 10m. Past it, the Restore fails with reason RestoreTimedOut and the namespace stays held.

Addon.spec.runtimes[].attributes.settings[]

FieldType and limitsDescription
constraintsobject, Addon.spec.runtimes[].attributes.settings[].constraintsWhat an object must keep at admission, beside its schema, which is its Function's contract.
functionobject, Addon.spec.runtimes[].attributes.function, requiredThe Function that applies a target's objects: an image, from which funcd creates one Function for each target that an object of the kind names, or an existing Function of the target's namespace. A target may name its own in its spec.functions.
kindstring, requiredThe settings kind, a kind name as the Addon's kind is, served at its plural.
resyncstring, a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)How often funcd sends a target's objects again with no change, from 1s to 24h; unset is 10m.
targetstring, requiredThe string field under spec.config that names the object's target, such as spec.config.provider. A replace of the Addon cannot change it.

Addon.spec.runtimes[].attributes.settings[].constraints

FieldType and limitsDescription
countobject, Addon.spec.runtimes[].attributes.settings[].constraints.countHow many objects of the kind a target or a namespace holds at most; 0 is no limit.
immutablearray of string valuesFields under spec.config that a replace cannot change.
rulesarray of Addon.spec.runtimes[].attributes.settings[].constraints.rules[]Conditions over object, oldObject and others that a write must meet.
uniquearray of string valuesFields under spec.config whose value no two objects of the kind in a namespace share.

Addon.spec.runtimes[].attributes.settings[].constraints.count

FieldType and limitsDescription
perNamespaceinteger, at least 0The most objects of the kind in a namespace.
perTargetinteger, at least 0The most objects of the kind that name one target.

Addon.spec.runtimes[].attributes.settings[].constraints.rules[]

FieldType and limitsDescription
messagestring, requiredWhat a refusal says.
rulestring, requiredA single ${{ }} condition over object, oldObject (on a replace) and others.

Addon.spec.runtimes[].attributes.snapshot

FieldType and limitsDescription
pathstring, requiredThe folder in the engine where it writes its copies: under storage.path, and neither restore.path nor inside it. A Backup copies the newest regular file there whose name does not end in ~ and that has not changed for 2 s, as it is.

Addon.spec.runtimes[].attributes.storage

FieldType and limitsDescription
gidinteger, at least 0The group ID that owns the directory.
pathstring, requiredWhere the directory is mounted in the engine, an absolute path.
uidinteger, at least 0The user ID that owns the directory: the user the engine's image runs as.

Addon.status

FieldType and limitsDescription
conditionsarray of ConditionThe conditions that explain the phase.
currentRevisionstring, a DNS-1123 labelThe AddonRevision of the Addon's latest spec: an object created, or edited outside an App, pins it, and an App's new revision records it. Empty until funcd has stamped the Addon's first revision.
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.

AddonObject

apiVersion: funcd.io/v1alpha1
kind: IdentityProvider
metadata:
  name: login
  namespace: default
  resourceGroup: default
spec:
  config:
    publicHost: login.example.com
    https: true
  bindings:
    secret:
      - rauthy-keys
  ingress:
    host: login.example.com
apiVersionkind
funcd.io/v1alpha1AddonObject

AddonObject.spec

FieldType and limitsDescription
bindingsobject, AddonObject.spec.bindingsWhat the object's engine uses, and what the Functions that funcd creates for the object from its kinds' images use. An object of a settings kind takes none, nor does one of an engineless kind whose Function is a ref.
configany JSON valueThe object's settings, which its kind's schema checks: the config schema of its Addon's kind entry when the object runs an engine, else the contract of the kind's Function. Unset is an empty object.
deletionstring, one of retain, deleteWhat becomes of the engine's storage once the object is deleted and its engine is gone: retain, the default, moves it into the quarantine for storage.quarantineRetention, from which it comes back by hand with funcd stopped; delete removes it. A new object of the same name starts empty either way. For an object of an Engineless kind, delete holds the object at its deletion, with metadata.deletionTimestamp set, until its Function answers ok to a call that carried it as deleting; retain lets it go at once, and the Function forgets it.
functionsarray of AddonObject.spec.functions[]The object's own Function for a settings kind of its Addon, or for its own kind when that kind is Engineless, in place of the kind's function, so each copy of an App template applies its own objects. The objects it applies have no schema. A settings object names none.
ingressobject, AddonObject.spec.ingressExposes the engine at the edge, on ingress.host under its Addon's basePath, while the object is Ready. Its own ingress.auth alone decides the stance, open when unset; ingress.path and the authenticated mode are refused. An object of a settings or an engineless kind takes none.
kindstringThe add-on's kind, which funcd sets from the path the object is written at.
resourcesobject, AddonObject.spec.resourcesThe cpu and memory of the object's engine. An empty cpu or memory sets no limit, and a change replaces the running engine. An object of a settings or an engineless kind takes none.

AddonObject.spec.bindings

FieldType and limitsDescription
jobarray of AddonObject.spec.bindings.job[]The Jobs whose runs the Function that funcd creates for an engineless object starts and reads, by their alias. Only an object of an engineless kind whose function is an image takes them.
secretarray of string values, each a DNS-1123 labelSecrets of the namespace whose keys, those that its Addon's kind entry lists in secretKeys, reach the engine's environment. funcd asks Cedar, as the object, for secret::read on each: a missing Secret holds the object in Pending with SecretNotFound, and a forbidden one with BindingResolveFailed. A changed value replaces the engine. The Functions that funcd creates for the object read every key of them.

AddonObject.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.

AddonObject.spec.functions[]

FieldType and limitsDescription
kindstring, requiredA settings kind of the object's Addon, named once.
refstring, required, a DNS-1123 labelA Function of the object's namespace that binds the object in its bindings.addon, which funcd calls with the object's settings objects of the kind. In an App, a Function the App declares.

AddonObject.spec.ingress

FieldType and limitsDescription
authobject, AddonObject.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.

AddonObject.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.

AddonObject.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.

AddonObject.status

FieldType and limitsDescription
addonRevisionstring, a DNS-1123 labelThe AddonRevision whose spec the engine runs. A newer revision of the Addon moves no object: an edit of the object moves it to the Addon's current revision, and for an App's part, the App's revision moves it.
addressstringThe engine's own address, its host and port, which only funcd reaches.
appRevisionstring, a DNS-1123 labelFor an App's part, the AppRevision whose record for its kind it pins: the App's latest revision once that one is applied. A part moves forward only.
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.
restoreobject, AddonObject.status.restoreThe in-place Restore whose copy the engine loads: it goes once an engine started without restore.env is Ready, or once that Restore has failed or is gone. While it stands, the namespace is held.
workloadstring, one of Function, Job, Engine, EnginelessThe workload of the object's kind, which funcd stores at the object's first pass: Engineless for a kind whose objects run no engine, Engine once funcd has tried to start its engine. No call of its Function carries the object before then, and a deletion holds only an Engineless object. An Addon created again for the kind keeps it.

AddonObject.status.restore

FieldType and limitsDescription
filestring, requiredThe copy's file name in the Addon's restore.path.
restorestring, required, a DNS-1123 labelThe Restore that placed the copy.
statestring, required, one of Loading, LoadedLoading while the engine starts with restore.env to load the copy; Loaded once the copy is gone, while the engine starts again without restore.env.

AddonRevision

apiVersionkind
funcd.io/v1alpha1AddonRevision

AddonRevision.spec

FieldType and limitsDescription
addonstring, required, a DNS-1123 labelThe Addon this revision belongs to.
numberinteger, required, at least 1The Addon's generation when funcd stamped this revision. Numbers may skip: funcd stamps the generation it reads.
specobject, Addon.spec, requiredThe Addon's spec at that generation. It never changes: an object that pins this revision runs its engine from it.

AddonRevision.status

FieldType and limitsDescription
contractsarray of AddonRevision.status.contracts[]The contract and the runtime of each kind whose function is an image, once funcd has read them from the registry.

AddonRevision.status.contracts[]

FieldType and limitsDescription
contractobject, AddonRevision.status.contracts[].contract, requiredThe image's contract. What it says of one object's config is the kind's schema.
kindstring, requiredThe kind whose function is the image.
runtimestring, required, a DNS-1123 labelThe runtime that the image declares, on which the kind's Functions run.

AddonRevision.status.contracts[].contract

FieldType and limitsDescription
dialectstringThe URI of the JSON Schema dialect that input and output follow. funcd checks nothing against it.
inputany JSON valueThe JSON Schema of the input. A declared one must be an object, and each property it does not require must declare a default.
outputany JSON valueThe JSON Schema of the output. A declared one must be an object, and each property it does not require must declare a default.

Handler API

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

ctx.addon

The add-on objects that the function binds, by alias: fetch calls an object's engine through funcd, which serves only the paths that the object's edge entry serves.

MethodWhat it does
fetch(alias: string, path: string, init?: RequestInit): Promise<Response>Sends an HTTP request to the engine of the add-on object that the function binds under alias, through funcd, and returns the engine's answer as a Response, whatever its status; funcd follows no redirect. path starts with "/" and may carry a query, and init sets the method, the headers and the body, as for the global fetch. Rejects with an AddonError when funcd refuses the call: 403 for an alias the function does not bind or a call a Policy forbids, 404 for a path the object's edge entry does not serve, 413 for a request or an answer body over addons.callPayloadLimit, 1 MiB by default, and 503 while the object is not Ready, while its namespace is held (with retryAfter), or when the engine does not answer within addons.callTimeout, 10 seconds by default.

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
fetch403urn:funcd:problem:forbiddenThe Function binds no add-on object under the alias.Call an alias of spec.bindings.addon, or add it there.
fetch403urn:funcd:problem:forbiddenCedar denies the Function addon::call on the object, as when a Policy forbids it.Ask the operator to lift the forbid.
fetch404urn:funcd:problem:not-foundThe path names no alias, or the object's edge entry would refuse it: outside its Addon's basePath, under one of its privatePaths, or with a .. segment.Call a path under the Addon's basePath that it does not keep private.
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 engine's answer body is larger than addons.callPayloadLimit.Ask for less, or ask the operator to raise addons.callPayloadLimit.
fetch503urn:funcd:problem:unavailableThe caller's namespace is held while a Restore loads its data.Retry after the Retry-After seconds.
fetch503urn:funcd:problem:unavailableThe add-on object is not Ready, has no engine address yet, or its engine refused the connection.Wait until the object is Ready, then retry.
fetch503urn:funcd:problem:unavailableThe engine did not answer within addons.callTimeout.Retry, or ask the operator to raise addons.callTimeout.
fetch503urn:funcd:problem:unavailableThe engine's answer ended before its body did.Retry.

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/addonsList the Addons
POST/apis/funcd.io/v1alpha1/addonsCreate an Addon
GET/apis/funcd.io/v1alpha1/addons/{name}Read an Addon
PUT/apis/funcd.io/v1alpha1/addons/{name}Replace an Addon
DELETE/apis/funcd.io/v1alpha1/addons/{name}Delete an Addon
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/{plural}List the objects of an add-on's kind in a namespace
POST/apis/funcd.io/v1alpha1/namespaces/{namespace}/{plural}Create an object of an add-on's kind
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/{plural}/{name}Read an object of an add-on's kind
PUT/apis/funcd.io/v1alpha1/namespaces/{namespace}/{plural}/{name}Replace an object of an add-on's kind
DELETE/apis/funcd.io/v1alpha1/namespaces/{namespace}/{plural}/{name}Delete an object of an add-on's kind
GET/apis/funcd.io/v1alpha1/namespaces/{namespace}/{plural}/{name}/logsRead the logs of an add-on object's engine
GET/apis/funcd.io/v1alpha1/addonrevisionsList the AddonRevisions
GET/apis/funcd.io/v1alpha1/addonrevisions/{name}Read an AddonRevision

On this page