reference
Functions
A function is a container that answers HTTPS requests on its own address. It runs no instance while nothing calls it, adds instances as requests arrive, and stops them again when requests stop. Functions run on Glenr Cloud.
What a function is
A function is a resource of kind function, shown as Function in the console. It runs a container you built or pulled, like a web service, and it listens on one HTTP port. It differs from a web service in how many instances run. A web service holds a fixed number or an autoscale range between 1 and 20. A function holds none while idle and between 1 and its maxInstances while requests arrive.
When no request has arrived for a while, the last instance stops. The first request after that starts an instance and waits for it. The console states about 2 seconds for this first request. The measurement behind it, on 2026-11-23 with the image already on the server, was 1.76 seconds at the median and 2.24 seconds at the 95th percentile. The idle wait before the last instance stops is fixed and is not a setting; the same run measured 92 seconds at the median and 100 at most.
The Overview page of a function shows Awake with the number of running instances out of its maximum, or Asleep with none running. A paused function answers no requests until it is resumed.
Create one
In the console, choose New, then Function. The form has a Requests step with the three values below. In a glenr.yaml, set the kind. A function takes the same port, image or repository keys as a web service.
resources:
- name: hook
kind: function
port: 8080
health: /healthz # optional: an HTTP path on that portA function is always public: it answers on a generated address under apps.glenr.io and on a custom domain you attach. expose: public and an empty expose are accepted, and expose: internal is refused.
The three values
A function has three values. They are values, not keys of glenr.yaml, because each environment sets its own: a function can scale to 2 instances in staging and 20 in production. Set them on the function's Settings page, in the Requests step of the create form, or in apps.<name>.values of a values file.
| Value | Meaning | Range | Default |
|---|---|---|---|
maxInstances | The most instances the function scales to. It also sets what the function reserves against the environment: the function counts at this number. | 1 to 20 on Glenr Cloud | 1 |
concurrency | How many requests one instance takes at once before another instance is added. 0 means no fixed number. | 0 to 1000 | 0 |
timeout | How long one request may run, in seconds. | 1 to 300 | 60 |
glenr: values/v1
environment: production
apps:
hook:
values:
maxInstances: 5
concurrency: 10
timeout: 120Writing one of the three in glenr.yaml is refused with a sentence that names the values file and the Settings page. A value outside its range is refused with the range. The size of a function comes from the size grid like any resource, see Instance sizes and quota. replicas and the scale.* keys do not apply to a function and are refused with the kind named.
The default timeout is 60 seconds because the platform uses the request timeout as the time an instance gets to finish when it stops. A longer timeout delays every scale-down by as much.
Where it runs
The zones in Helsinki, Finland and Warsaw, Poland run functions. Glenr Cloud environments run in Helsinki, Finland; Warsaw, Poland opens to Glenr Cloud when its prices are published. A zone that does not run functions refuses a function with the kind named. A function on Glenr Cloud follows the placement of its Cell like any other resource; see Move an environment to another location for the locations an environment can move to.
Glenr Go does not create new functions. The refusal reads Functions are not available on Glenr Go. They are on Glenr Cloud: write to support@glenr.io to move <organisation> to Glenr Cloud. A function that already exists keeps running and keeps its settings, and on Glenr Go its maxInstances is 1 or 2.
What a function refuses
| Subject | Rule |
|---|---|
| Ports | Exactly one TCP port. The platform sets the variable PORT to it, and the function listens on that port on 0.0.0.0. |
| State | A function keeps nothing between requests. A volume, a file, a persistent volume and an init container (before) are refused, each naming the field. |
| Exposure | Public only. expose: internal is refused: a function is reached on its own HTTPS address. Make the resource a web service if only resources in the environment should reach it. |
| Schedule | A function does not run on a schedule. A schedule is refused and points to a cron job. |
| Health checks | An HTTP path on the port. An exec probe, an HTTPS probe and header probes are refused. A startup window is refused, because requests wait until the first readiness check passes. |
| Variables | PORT, K_SERVICE, K_CONFIGURATION and K_REVISION are set by the platform and refused as variable names. A variable value cannot be a ${resources.<name>.<output>} reference; set the value itself, or read the variable a database connection delivers, for example MAINDB_URL. |
| Name | A name that ends in a dash and five digits (for example hook-00001) is refused, because the platform names a function's revisions that way. |
A function can connect to a database with connects, and receives the same variables, certificate file and TLS settings as a web service. See Variables Glenr sets.
Usage and billing
The meter counts the seconds each instance runs, at the rate of its size in the location where it runs. A function with no running instance adds no usage. The rates are on the pricing page.
Each instance also runs a small helper container that receives requests first. The helper is platform overhead: it is outside your plan allowance and is not billed.
