Skip to content
Stackship documentation Svenska

Stackship platformAdministrators

What an agent cluster reports

The requests an agent cluster's operator sends the platform over its agent connection, what they make visible, how the platform limits and answers them, and the operator setting that bounds how long it waits.

The operator in an Agent cluster reaches the platform only over the connection its agent dials out — see Connectivity. What the operator reports about its own work travels over that connection as hub requests, which the platform authorizes against the cluster the connection belongs to before acting on them.

Note

Agent clusters cannot be enrolled yet — see Agent clusters. This page describes what an enrolled agent cluster reports once one can be.

What the platform accepts

Hub request What it does What it makes visible
operation.step.add, operation.step.update Adds or updates a step of an operation on a resource placed on the cluster. The operation's progress — see Operations.
operation.complete Marks such an operation succeeded or failed. The operation's final status.
deployment.log.create, deployment.log.update Records a deployment of an app, static web app or function namespace placed on the cluster, and moves it through its phases. The resource's deployment history — see Deployment history.
deployment.log.upload Stores the build output of an app or static web app deployment. The deployment's build log — see Build logs.

Before these were accepted, an agent cluster's operation steps and deployment history were never recorded: operations on its resources showed no progress, and its deployments no history or build log.

Every other request the operator makes of the platform — for example function build output, Git tokens for a build, function source, managed identities and Crosslink — is not served over the agent connection yet, and fails on an agent cluster.

Authorization

The platform acts on a request only for the cluster the agent connection authenticated as, never for a cluster the request names:

  • a deployment log is accepted only when its boundary is projected onto the cluster and the resource it names is placed on that cluster. Updating an entry or uploading its build output also requires the entry to belong to that same resource: the entry of any other resource is not found, even in the same boundary;
  • an operation is accepted only when it belongs to a boundary projected onto the cluster and to a resource placed on that cluster.

A request that fails these checks is answered as not found (404), so a cluster cannot learn whether another cluster's operation or entry exists. A use no cluster may make at all, such as writing a platform-wide operation, is refused (403).

Limits and answers

Answer When
400 The request's payload cannot be read, or does not name a resource that keeps deployment history.
403 The request is of a kind no cluster may make for that object.
404 The request names a kind the platform does not know, or an object that is not this cluster's — see Authorization.
413 The request is larger than 4 MiB.
429 The cluster already has 16 requests in flight. The platform refuses the request rather than queueing it, so a cluster that floods its connection waits on itself, not on other clusters.
501 The kind is known but not served over the agent connection yet — see What the platform accepts.
500 The platform could not serve the request. The details are logged on the platform, not sent to the cluster.
503 The service that owns the resource is not available.

Any other answer is the one the owning service gave, passed through unchanged.

The operator learns on connecting which kinds the platform serves, and fails a call of any other kind at once, without sending it.

Deployment-log routes

The HTTP routes that write deployment history — create, update and upload build output for apps, their slots and static web apps, and create and update for function namespaces — take the OperatorReport authorization policy. It admits two callers:

  • the platform cluster's operator, with the same service-account token as before;
  • the platform itself, writing on behalf of an agent cluster's operator after the checks in Authorization. Its client is stackship-api-m2m, set by OperatorReport:KernelClientIds.

Any other signed-in caller is refused with 403; a call with no token, or one that is not valid, is refused with 401. An update or upload that names an entry of another resource than its route is answered 404.

Operator setting

The operator waits a bounded time for the platform's answer to each hub request. The setting is in section Agent of the operator's appsettings.json, and reaches it as an environment variable read when it starts.

Environment variable Default Meaning
Agent__HubRequestTimeoutSeconds 30 How long, in seconds, the operator waits for the answer to one hub request. The platform answers every request it receives, so running out means the connection or the platform is in trouble: the call fails, and the operator carries on with its reconcile rather than holding it. Values below 1 are treated as 1.

When the agent connection is down, a hub request fails at once rather than waiting.